Package commonj.sdo.helper

Examples of commonj.sdo.helper.CopyHelper


    }

    @Override
    public Object copy(Object arg, DataType dataType, DataType targetDataType, Operation operation, Operation targetOperation) {
        HelperContext context = SDOContextHelper.getHelperContext(operation);
        CopyHelper copyHelper = context.getCopyHelper();
        if (arg instanceof XMLDocument) {
            XMLDocument document = (XMLDocument)arg;
            DataObject dataObject = copyHelper.copy(document.getRootObject());
            return context.getXMLHelper().createDocument(dataObject,
                                                         document.getRootElementURI(),
                                                         document.getRootElementName());
        } else if (arg instanceof DataObject) {
            return context.getCopyHelper().copy((DataObject)arg);
View Full Code Here


    }

    @Override
    public Object copy(Object arg) {
        HelperContext context = HelperProvider.getDefaultContext();
        CopyHelper copyHelper = context.getCopyHelper();
        if (arg instanceof XMLDocument) {
            XMLDocument document = (XMLDocument)arg;
            DataObject dataObject = copyHelper.copy(document.getRootObject());
            return context.getXMLHelper().createDocument(dataObject,
                                                         document.getRootElementURI(),
                                                         document.getRootElementName());
        } else if (arg instanceof DataObject) {
            return context.getCopyHelper().copy((DataObject)arg);
View Full Code Here

    }

    @Override
    public Object copy(Object arg) {
        HelperContext context = HelperProvider.getDefaultContext();
        CopyHelper copyHelper = context.getCopyHelper();
        if (arg instanceof XMLDocument) {
            XMLDocument document = (XMLDocument)arg;
            DataObject dataObject = copyHelper.copy(document.getRootObject());
            return context.getXMLHelper().createDocument(dataObject,
                                                         document.getRootElementURI(),
                                                         document.getRootElementName());
        } else if (arg instanceof DataObject) {
            return context.getCopyHelper().copy((DataObject)arg);
View Full Code Here

   
   private int indent = 0;
   
   public void testCrossScopeCopy() throws IOException
   {
       CopyHelper copyHelperB = SDOUtil.createCrossScopeCopyHelper(scopeB);
      
       // Perform Shallow Copy Test
       DataObject copiedSDO = copyHelperB.copyShallow(bankSDO);
       shallowCopyAssertions(bankSDO, copiedSDO);
      
       // Perform Deep Copy Test
       copiedSDO = copyHelperB.copy(bankSDO);
       deepCopyAssertions(bankSDO, copiedSDO);
      
       // Inter-Reference Copy
       copiedSDO = copyHelperB.copy(customerSDO1);
       DataObject prop = (DataObject)copiedSDO.get("HomeBranch");
       assertTrue(prop==null);
      
       // Perform invalid namespace test
       DataObject sdo = SDOUtil.createDataFactory(scopeA).create(TEST_NAMESPACE, DYNAMIC_TYPE );
       sdo.set("custNum", "099" );
       sdo.set("firstName", "John");
       sdo.set("lastName", "Doe");
       boolean failed = false;
       try
       {
           // In this case, we are copying an object to a scope
           // where the object's type has not been defined.  That
           // will generate a null pointer exception what we will
           // catch.
           copyHelperB.copy(sdo);
       }
       catch(java.lang.NullPointerException ex)
       {
           failed = true;
       }
View Full Code Here

    }

    @Override
    public Object copy(Object arg, DataType dataType, DataType targetDataType, Operation operation, Operation targetOperation) {
        HelperContext context = SDOContextHelper.getHelperContext(operation);
        CopyHelper copyHelper = context.getCopyHelper();
        if (arg instanceof XMLDocument) {
            XMLDocument document = (XMLDocument)arg;
            DataObject dataObject = copyHelper.copy(document.getRootObject());
            return context.getXMLHelper().createDocument(dataObject,
                                                         document.getRootElementURI(),
                                                         document.getRootElementName());
        } else if (arg instanceof DataObject) {
            return context.getCopyHelper().copy((DataObject)arg);
View Full Code Here

    }

    @Override
    public Object copy(Object arg) {
        HelperContext context = HelperProvider.getDefaultContext();
        CopyHelper copyHelper = context.getCopyHelper();
        if (arg instanceof XMLDocument) {
            XMLDocument document = (XMLDocument)arg;
            DataObject dataObject = copyHelper.copy(document.getRootObject());
            return context.getXMLHelper().createDocument(dataObject,
                                                         document.getRootElementURI(),
                                                         document.getRootElementName());
        } else if (arg instanceof DataObject) {
            return context.getCopyHelper().copy((DataObject)arg);
View Full Code Here

    }

    @Override
    public Object copy(Object arg, DataType dataType, Operation operation) {
        HelperContext context = SDOContextHelper.getHelperContext(operation);
        CopyHelper copyHelper = context.getCopyHelper();
        if (arg instanceof XMLDocument) {
            XMLDocument document = (XMLDocument)arg;
            DataObject dataObject = copyHelper.copy(document.getRootObject());
            return context.getXMLHelper().createDocument(dataObject,
                                                         document.getRootElementURI(),
                                                         document.getRootElementName());
        } else if (arg instanceof DataObject) {
            return context.getCopyHelper().copy((DataObject)arg);
View Full Code Here

    }

    @Override
    public Object copy(Object arg, DataType dataType, DataType targetDataType, Operation operation, Operation targetOperation) {
        HelperContext context = SDOContextHelper.getHelperContext(operation);
        CopyHelper copyHelper = context.getCopyHelper();
        if (arg instanceof XMLDocument) {
            XMLDocument document = (XMLDocument)arg;
            DataObject dataObject = copyHelper.copy(document.getRootObject());
            return context.getXMLHelper().createDocument(dataObject,
                                                         document.getRootElementURI(),
                                                         document.getRootElementName());
        } else if (arg instanceof DataObject) {
            return context.getCopyHelper().copy((DataObject)arg);
View Full Code Here

    }

    @Override
    public Object copy(Object arg) {
        HelperContext context = HelperProvider.getDefaultContext();
        CopyHelper copyHelper = context.getCopyHelper();
        if (arg instanceof XMLDocument) {
            XMLDocument document = (XMLDocument)arg;
            DataObject dataObject = copyHelper.copy(document.getRootObject());
            return context.getXMLHelper().createDocument(dataObject,
                                                         document.getRootElementURI(),
                                                         document.getRootElementName());
        } else if (arg instanceof DataObject) {
            return context.getCopyHelper().copy((DataObject)arg);
View Full Code Here

    }

    @Override
    public Object copy(Object arg, DataType dataType, Operation operation) {
        HelperContext context = SDOContextHelper.getHelperContext(operation);
        CopyHelper copyHelper = context.getCopyHelper();
        if (arg instanceof XMLDocument) {
            XMLDocument document = (XMLDocument)arg;
            DataObject dataObject = copyHelper.copy(document.getRootObject());
            return context.getXMLHelper().createDocument(dataObject,
                                                         document.getRootElementURI(),
                                                         document.getRootElementName());
        } else if (arg instanceof DataObject) {
            return context.getCopyHelper().copy((DataObject)arg);
View Full Code Here

TOP

Related Classes of commonj.sdo.helper.CopyHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.