Examples of XmlSchemaSimpleType


Examples of org.apache.ws.commons.schema.XmlSchemaSimpleType

        return newSchemaType;
    }
   
    private XmlSchemaSimpleType duplicateXmlSchemaSimpleType(Scope newScope) {
        XmlSchemaSimpleType oldSimpleType = (XmlSchemaSimpleType) getSchemaType();
        XmlSchemaSimpleType simpleType = new XmlSchemaSimpleType(schema);
        simpleType.setContent(oldSimpleType.getContent());
        simpleType.setName(newScope.toString());
        return simpleType;
    }
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaSimpleType

            System.out.println("Scale cannot be greater than digits");
            return;
        }
       
        // xmlschema:fixed
        XmlSchemaSimpleType fixedSimpleType = new XmlSchemaSimpleType(schema);
        XmlSchemaSimpleTypeRestriction fixedRestriction = new XmlSchemaSimpleTypeRestriction();
        fixedRestriction.setBaseTypeName(Constants.XSD_DECIMAL);
        XmlSchemaTotalDigitsFacet fixedTotalDigits = new XmlSchemaTotalDigitsFacet();
        fixedTotalDigits.setValue(digitsNode.toString());
        XmlSchemaFractionDigitsFacet fixedFractionDigits = new XmlSchemaFractionDigitsFacet();
        fixedFractionDigits.setValue(scaleNode.toString());
        fixedFractionDigits.setFixed(true);
        fixedRestriction.getFacets().add(fixedTotalDigits);
        fixedRestriction.getFacets().add(fixedFractionDigits);
        fixedSimpleType.setName(scopedName.toString());
        fixedSimpleType.setContent(fixedRestriction);

        // add xmlschema:fixed
        setSchemaType(fixedSimpleType);

       
        // corba:fixed
        Fixed corbaFixed = new Fixed();
        corbaFixed.setQName(new QName(typeMap.getTargetNamespace(), scopedName.toString()));
        corbaFixed.setDigits(digits);
        corbaFixed.setScale(scale);
        corbaFixed.setRepositoryID(scopedName.toIDLRepositoryID());
        //corbaFixed.setType(Constants.XSD_DECIMAL);
        corbaFixed.setType(fixedSimpleType.getQName());
       
        // add corba:fixed
        setCorbaType(corbaFixed);
    }
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaSimpleType

        }
    }
   
    private void visitAnonBoundedString() {
        // xmlschema:bounded anon string
        XmlSchemaSimpleType simpleType = new XmlSchemaSimpleType(schema);
        simpleType.setName(stringScopedName.toString());
        XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
        restriction.setBaseTypeName(Constants.XSD_STRING);
        XmlSchemaMaxLengthFacet maxLengthFacet = new XmlSchemaMaxLengthFacet();
        maxLengthFacet.setValue(boundNode.toString());
        restriction.getFacets().add(maxLengthFacet);
        simpleType.setContent(restriction);

        // add schemaType
        schema.getItems().add(simpleType);
        schema.addType(simpleType);
        setSchemaType(simpleType);

        // corba:anonstring
        Anonstring anonstring = new Anonstring();
        anonstring.setQName(new QName(typeMap.getTargetNamespace(), stringScopedName.toString()));
        anonstring.setBound(new Long(boundNode.toString()));
        anonstring.setType(simpleType.getQName());
       
        // add corba:anonstring
        typeMap.getStructOrExceptionOrUnion().add(anonstring);
        setCorbaType(anonstring);
    }
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaSimpleType

        setCorbaType(anonstring);
    }
   
    private void visitBoundedString() {
        // xmlschema:bounded string
        XmlSchemaSimpleType simpleType = new XmlSchemaSimpleType(schema);
        simpleType.setName(stringScopedName.toString());
        XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
        restriction.setBaseTypeName(Constants.XSD_STRING);
        XmlSchemaMaxLengthFacet maxLengthFacet = new XmlSchemaMaxLengthFacet();
        maxLengthFacet.setValue(boundNode.toString());
        restriction.getFacets().add(maxLengthFacet);
        simpleType.setContent(restriction);

        setSchemaType(simpleType);
       
       
        //String anonstringName = new String("_1_" + stringScopedName.toString());
        Scope anonstringScopedName = new Scope(getScope(), "_1_" + stringScopedName.tail());
        String anonstringName = anonstringScopedName.toString();
        CorbaTypeImpl anon = null;
        if (stringNode.getType() == IDLTokenTypes.LITERAL_string) {
            // corba:anonstring
            Anonstring anonstring = new Anonstring();
            anonstring.setQName(new QName(typeMap.getTargetNamespace(), anonstringName));
            anonstring.setBound(new Long(boundNode.toString()));
            anonstring.setType(simpleType.getQName());

            anon = anonstring;
           
        } else if (stringNode.getType() == IDLTokenTypes.LITERAL_wstring) {
            // corba:anonwstring
            Anonwstring anonwstring = new Anonwstring();
            anonwstring.setQName(new QName(typeMap.getTargetNamespace(), anonstringName));
            anonwstring.setBound(new Long(boundNode.toString()));
            anonwstring.setType(simpleType.getQName());
           
            anon = anonwstring;
           
        } else {
            // should never get here
            throw new RuntimeException("StringVisitor attempted to visit an invalid node");
        }
       
        // add corba:anonstring
        typeMap.getStructOrExceptionOrUnion().add(anon);

        // corba:alias
        Alias alias = new Alias();
        alias.setQName(new QName(typeMap.getTargetNamespace(), stringScopedName.toString()));
        alias.setBasetype(anon.getQName());
        alias.setType(simpleType.getQName());
        alias.setRepositoryID(stringScopedName.toIDLRepositoryID());

        // add corba:alias
        setCorbaType(alias);
    }
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaSimpleType

   
    private void generateAlias(AST identifierNode,
                               XmlSchemaType schemaType,
                               CorbaTypeImpl corbaType) {
        // xmlschema:simpleType
        XmlSchemaSimpleType simpleType = new XmlSchemaSimpleType(schema);
        Scope scopedName = new Scope(getScope(), identifierNode);
        simpleType.setName(scopedName.toString());
        XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
        restriction.setBaseTypeName(schemaType.getQName());
        simpleType.setContent(restriction);
       
        // add xmlschema:simpleType
        setSchemaType(simpleType);

       
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaSimpleType

       
        AST enumNameNode = enumNode.getFirstChild();
        Scope enumNameScope = new Scope(getScope(), enumNameNode);

        // xmlschema:enum
        XmlSchemaSimpleType enumSchemaSimpleType = new XmlSchemaSimpleType(schema);
        enumSchemaSimpleType.setName(enumNameScope.toString());
       
        XmlSchemaSimpleTypeRestriction enumSchemaSimpleTypeRestriction = new XmlSchemaSimpleTypeRestriction();
        enumSchemaSimpleTypeRestriction.setBaseTypeName(Constants.XSD_STRING);
       
        //XmlSchemaSimpleTypeContent xmlSchemaSimpleTypeContent = enumSchemaSimpleTypeRestriction;
        enumSchemaSimpleType.setContent(enumSchemaSimpleTypeRestriction);

       
        // corba:enum
        Enum corbaEnum = new Enum();
        corbaEnum.setQName(new QName(typeMap.getTargetNamespace(), enumNameScope.toString()));
        corbaEnum.setRepositoryID(enumNameScope.toIDLRepositoryID());
        corbaEnum.setType(enumSchemaSimpleType.getQName());
       
       
        AST node = enumNameNode.getNextSibling();
        while (node != null) {
            // xmlschema:enumeration
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaSimpleType

    }

    @Override
    public void writeSchema(XmlSchema root) {
        if (serializedWhenUnknown) {
            XmlSchemaSimpleType simple = new XmlSchemaSimpleType(root, true);
            simple.setName("serializedJavaObject");
            XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
            simple.setContent(restriction);
            restriction.setBaseTypeName(XmlSchemaConstants.BASE64BINARY_QNAME);
        }
    }
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaSimpleType

        } else  {
            QName typeName = getTypeName(beanInfo);
            if (typeName != null) {
                XmlSchemaType type = schemas.getTypeByQName(typeName);
                if  (isList && type instanceof XmlSchemaSimpleType) {
                    XmlSchemaSimpleType simpleType = new XmlSchemaSimpleType(type.getParent(), false);
                    XmlSchemaSimpleTypeList list = new XmlSchemaSimpleTypeList();
                    XmlSchemaSimpleType stype = (XmlSchemaSimpleType)type;
                    list.setItemTypeName(stype.getQName());
                    simpleType.setContent(list);
                    part.setXmlSchema(simpleType);
                    if (part.getConcreteName() == null) {
                        part.setConcreteName(new QName(null, part.getName().getLocalPart()));
                    }
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaSimpleType

        if (namespace != null && type != null && !"void".equals(type)) {
            returnType.setClassName(ProcessorUtil.getFullClzName(part, context, false));
        }
       
        if (part != null && part.getXmlSchema() instanceof XmlSchemaSimpleType) {
            XmlSchemaSimpleType simpleType = (XmlSchemaSimpleType)part.getXmlSchema();
            if (simpleType.getContent() instanceof XmlSchemaSimpleTypeList && !part.isElement()) {
                method.annotate(new XmlListAnotator(method.getInterface()));
            }
        }
       
        method.setReturn(returnType);
View Full Code Here

Examples of org.apache.ws.commons.schema.XmlSchemaSimpleType

        if (xst == null
            && "http://www.w3.org/2001/XMLSchema".equals(schemaTypeName.getNamespaceURI())) {
            XmlSchema sch = getSchemaByTargetNamespace(schemaTypeName.getNamespaceURI());
           
            if ("anySimpleType".equals(schemaTypeName.getLocalPart())) {
                XmlSchemaSimpleType type = new XmlSchemaSimpleType(sch);
                type.setName(schemaTypeName.getLocalPart());
                sch.addType(type);
                xst = type;
            } else if ("anyType".equals(schemaTypeName.getLocalPart())) {
                XmlSchemaType type = new XmlSchemaType(sch);
                type.setName(schemaTypeName.getLocalPart());
                sch.addType(type);
                xst = type;
            }
        }
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.