Package commonj.sdo

Examples of commonj.sdo.Type


        return p;
    }

    private void updateCollisionProperty(SDOType owningType, SDOProperty p) {
        owningType.setSequenced(true);
        Type baseType = owningType;
        while ((baseType.getBaseTypes() != null) && (baseType.getBaseTypes().size() > 0)) {
            baseType = (Type) baseType.getBaseTypes().get(0);
            ((SDOType) baseType).setSequenced(true);
        }
        p.setNameCollision(true);
        p.setType(SDOConstants.SDO_OBJECT);
        p.setContainment(true);
View Full Code Here


     */
    public Object convert(Property property, Object value) {
        if (null == property) {
            throw new IllegalArgumentException(SDOException.conversionError(null));
        }
        Type convertType = property.getType();
        if (property.isMany()) {
            if (value == null) {
                return null;
            } else if (!(value instanceof List)) {
                throw new IllegalArgumentException(SDOException.conversionError(null));
View Full Code Here

                    currentDataObject = (DataObject)currentDataObjects.peek();
                }
            }
            HelperContext aHelperContext = ((SDOType)currentDataObject.getType()).getHelperContext();
            if (currentSchemaType != null) {
                Type sdoType = ((SDOTypeHelper)aHelperContext.getTypeHelper()).getSDOTypeFromXSDType(currentSchemaType);

                if (sdoType != null) {
                    ((SDOProperty)currentProperty).setType(sdoType);
                }
View Full Code Here

            }
        } else {
            String typeName = localName;
            String typeUri = namespaceURI;
            QName typeAttribute = getTypeAttributeQName(atts);
            Type newType = null;
            if (typeAttribute != null) {
                typeName = typeAttribute.getLocalPart();
                typeUri = typeAttribute.getNamespaceURI();
                newType = aHelperContext.getTypeHelper().getType(typeUri, typeName);
            }
            if (newType == null) {
                newType = aHelperContext.getTypeHelper().getType(SDOConstants.ORACLE_SDO_URL, "OpenSequencedType");
                Type dataObjectType = aHelperContext.getTypeHelper().getType(SDOConstants.SDO_URL, "DataObject");
                Property property = defineNewSDOProperty(namespaceURI, localName, true, dataObjectType);
                DataObject newDO = aHelperContext.getDataFactory().create(newType);
                processAttributes(atts, newDO, false);
                currentDataObjects.push(newDO);
                depth++;
View Full Code Here

        SDOTypeHelper typeHelper = (SDOTypeHelper)aHelperContext.getTypeHelper();

        getXmlDocument().setRootElementName(localName);
        getXmlDocument().setRootElementURI(namespaceURI);
        Property rootElementProperty = aHelperContext.getXSDHelper().getGlobalProperty(namespaceURI, localName, true);
        Type rootObjectType = null;

        if (rootElementProperty != null) {
            rootObjectType = rootElementProperty.getType();
        } else {
            QName typeQName = getTypeAttributeQName(atts);
            if (typeQName != null) {
                String typeName = typeQName.getLocalPart();
                String typeUri = null;
                String prefix = typeQName.getPrefix();
                if (prefix == null) {
                    typeUri = null;
                } else {
                    Stack uriStack = (Stack)getNamespaceMap().get(prefix);
                    if(uriStack != null && uriStack.size() > 0) {
                        typeUri = (String)uriStack.peek();
                    }
                }
            rootObjectType = typeHelper.getType(typeUri, typeName);
            }           
        }

        DataObject rootObject = null;
        if (rootObjectType != null) {
            giveToOXToProcess(namespaceURI, localName, qName, atts, ((SDOType)rootObjectType).getXmlDescriptor());
            return;
        } else {
            Type rootType = aHelperContext.getTypeHelper().getType(SDOConstants.ORACLE_SDO_URL, "OpenSequencedType");
            rootObject = dataFactory.create(rootType);
        }
        currentDataObjects.push(rootObject);
        depth++;
        processAttributes(atts, rootObject, true);
View Full Code Here

        for (int i = 0; i < indent; i++)
            margin += "\t";
        if (value != null && property.isContainment()) {
            // For containment properties, display the value
            // with printDataObject
            Type type = property.getType();
            String typeName = type.getName();
            System.out.println(margin + propertyName + " (" + typeName + "):");
            printDataObject((DataObject) value, indent + 1);
        } else {
            // For non-containment properties, just print the value
            System.out.println(margin + propertyName + ": " + value);
View Full Code Here

        } else {

            /*
             * The following creates a DataObject without a DataGraph
             */
            Type companyType = TypeHelper.INSTANCE.getType(SdoSampleConstants.COMPANY_NAMESPACE, "CompanyType");
            // this is equivilent to
            // DataObject company = DataFactory.INSTANCE.create(SdoSampleConstants.COMPANY_NAMESPACE, "CompanyType");           
            company = DataFactory.INSTANCE.create(companyType);
        }

View Full Code Here

    private XSDHelper xsdHelper;
    private XMLHelper xmlHelper;
    private DataFactory dataFactory;
   
    public void testDefineOpenContentProperty() throws IOException {
        Type quoteType = typeHelper.getType(TEST_NAMESPACE, "OpenQuote");
        DataObject quote = dataFactory.create(quoteType);
       
        quote.setString("symbol", "s1");

        Property companyProperty = typeHelper.getOpenContentProperty(TEST_NAMESPACE, "company");
View Full Code Here

    /**
     * Simple Dynamic SDO 2 test.
     */
    public void testDynamic() throws IOException {
        Type quoteType = TypeHelper.INSTANCE.getType(TEST_NAMESPACE, "Quote");
        DataObject quote = DataFactory.INSTANCE.create(quoteType);

        quote.setString("symbol", "fbnt");
        quote.setString("companyName", "FlyByNightTechnology");
        quote.setBigDecimal("price", new BigDecimal("1000.0"));
View Full Code Here

    /**
     * Open content SDO 2 test.
     */
    public void testOpenType() throws IOException {
        Type quoteType = TypeHelper.INSTANCE.getType(TEST_NAMESPACE, "OpenQuote");
        DataObject quote = DataFactory.INSTANCE.create(quoteType);

        quote.setString("symbol", "s1");

        for (Iterator iter = quote.getInstanceProperties().iterator(); iter.hasNext();) {
View Full Code Here

TOP

Related Classes of commonj.sdo.Type

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.