Examples of XSClass


Examples of org.exolab.castor.builder.types.XSClass

        xmlNature.setNamespaceURI(schema.getTargetNamespace());
        xmlNature.setNodeName(typeName);

        extractAnnotations(simpleType, jClass);

        XSClass xsClass = new XSClass(jClass, typeName);

        xmlNature.setSchemaType(xsClass);

        //-- handle enumerated types
        if (enumeration) {
            xsClass.setAsEnumerated(true);
            processEnumeration(binding, simpleType, state);
        }

        //-- create Bound Properties code
        if (state.hasBoundProperties() && !enumeration) {
View Full Code Here

Examples of org.exolab.castor.builder.types.XSClass

        String typeName = component.getXMLName();

        ClassInfo classInfo = state.getClassInfo();
        XMLInfoNature xmlNature = new XMLInfoNature(classInfo);
        xmlNature.setSchemaType(new XSClass(state.getJClass(), typeName));

        /// I don't believe this should be here: kv 20030423
        ///classInfo.setNamespaceURI(component.getTargetNamespace());

        //- Handle derived types
View Full Code Here

Examples of org.exolab.castor.builder.types.XSClass

        //--currently anyAttribute is not supported
        if (any.isAttributeWildcard()) {
            return null;
        }

        XSType xsType    = new XSClass(SGTypes.OBJECT, "any");
        String vName     = "_anyObject";
        String xmlName   = null;
        FieldInfo result = null;

        if (any.getMaxOccurs() > 1 || any.getMaxOccurs() < 0) {
View Full Code Here

Examples of org.exolab.castor.builder.types.XSClass

     *
     * @return the new FieldInfo
     */
    public FieldInfo createFieldInfoForChoiceValue() {
        String fieldName = "_choiceValue";
        XSType xsType = new XSClass(SGTypes.OBJECT, "any");
        FieldInfo fInfo = null;
        fInfo = this.getInfoFactory().createFieldInfo(xsType, fieldName);
        fInfo.setComment("Internal choice value storage");
        fInfo.setTransient(true);
        fInfo.setMethods(FieldInfo.READ_METHOD);
View Full Code Here

Examples of org.exolab.castor.builder.types.XSClass

                                packageName = packageName + "." + SourceGeneratorConstants.TYPES_PACKAGE;
                            } else {
                                packageName = SourceGeneratorConstants.TYPES_PACKAGE;
                            }
                            JClass tempClass = new JClass(packageName+ "." + temp.getJavaClassName());
                            xsType = new XSClass(tempClass);
                            xsType.setAsEnumerated(true);
                        }
                    }
                   
                   
                }

                if (xsType == null) {
                    xsType = component.getJavaType();
                }
            } else if (xmlType.isAnyType()) {
                //-- Just treat as java.lang.Object.
                if (classInfo != null) {
                    XMLInfoNature xmlNature = new XMLInfoNature(classInfo);
                    xsType = xmlNature.getSchemaType();
                }
                if (xsType == null) {
                    xsType = new XSClass(SGTypes.OBJECT);
                }
            } else if (xmlType.isComplexType() && (xmlType.getName() != null)) {
                //--if we use the type method then no class is output for
                //--the element we are processing
                if (getConfig().mappingSchemaType2Java()) {
                    XMLBindingComponent temp = new XMLBindingComponent(
                            getConfig(), getGroupNaming());
                    temp.setBinding(component.getBinding());
                    temp.setView(xmlType);
                    ClassInfo typeInfo = resolver.resolve(xmlType);
                    if (typeInfo != null) {
                        // if we have not processed the <complexType> referenced
                        // by the ClassInfo yet, this will return null
                        // TODO find a way to resolve an unprocessed <complexType>
                        XMLInfoNature xmlNature = new XMLInfoNature(typeInfo);
                        xsType = xmlNature.getSchemaType();
                    } else {
                        String className = temp.getQualifiedName();
                        if (className != null) {
                            JClass jClass = new JClass(className);
                            if (((ComplexType) xmlType).isAbstract()) {
                                jClass.getModifiers().setAbstract(true);
                            }
                            xsType = new XSClass(jClass);
                            className = null;
                        }
                    }
                }
            } // complexType
        } else {
            if (xsType == null) {
                xsType = component.getJavaType();
            }

            if (xsType == null) {
                //-- patch for bug 1471 (No XMLType specified)
                //-- treat unspecified type as anyType
                switch (component.getAnnotated().getStructureType()) {
                case Structure.ATTRIBUTE:
                    AttributeDecl attribute = (AttributeDecl) component.getAnnotated();
                    if (!attribute.hasXMLType()) {
                        xsType = new XSClass(SGTypes.OBJECT);
                    }
                    break;               
                case Structure.ELEMENT:
                    ElementDecl element = (ElementDecl) component.getAnnotated();
                    if (!element.hasXMLType()) {
                        xsType = new XSClass(SGTypes.OBJECT);
                    }
                    break;
                default:
                    // probably a model-group
                    break;
                }
            }
        }

        // is the XSType found?
        if (xsType == null) {
            String className = component.getQualifiedName();
            JClass jClass = new JClass(className);
            if (component.isAbstract()) {
                jClass.getModifiers().setAbstract(true);
            }
            if (getConfig().isAutomaticConflictResolution()) {
                getSourceGenerator().getXMLInfoRegistry().bind(jClass,
                        component, "field");
            }
            xsType = new XSClass(jClass);
            if (xmlType != null && xmlType.isComplexType()) {
                ComplexType complexType = (ComplexType) xmlType;
                if (complexType.isAbstract() || getConfig().mappingSchemaElement2Java()) {
                    jClass.getModifiers().setAbstract(true);
                }
View Full Code Here

Examples of org.exolab.castor.builder.types.XSClass

                String javaType = _member.getJavaType();
                if (javaType != null && javaType.length() > 0) {
                    result = TypeConversion.convertType(javaType);
                }
            } else {
                result = new XSClass(new JClass(getJavaClassName()));
            }
        } else {
            if (_type == MEMBER) {
                String javaType = _member.getJavaType();
                if (javaType != null && javaType.length() > 0) {
View Full Code Here

Examples of org.exolab.castor.builder.types.XSClass

                            tmpClass = tmpInfo.getJClass();
                        }
                        else {
                  tmpClass = createSourceCode(simpleType, sgState);
              }
              classInfo.setSchemaType(new XSClass(tmpClass));                 
            }
                } else {
                    //////////////////////////////////////////////////////////
                    //NOTE: generate sources if the flag for generating sources
                    //from imported schemas is on
                    //////////////////////////////////////////////////////////
                    return new JClass[0];
                }
            }
            //--5c the type is an anyType
            else if (type.isAnyType()) {
                //-- Do not create classes for AnyType
                classInfo.setSchemaType(new XSClass(SGTypes.Object));
                return new JClass[0];
            }
        }
        //--no type we must be facing an XML schema group
        else {
            //--MODEL GROUP OR GROUP
            try{
                Group group = (Group)component.getAnnotated();
                createForSingleGroup = (group.getMaxOccurs() == 1);               
                processContentModel(group, state);
                component.setView(group);
                //-- Check Group Type
                Order order = group.getOrder();
                if (order == Order.choice)
                    classInfo.getGroupInfo().setAsChoice();
                else if (order == Order.seq)
                    classInfo.getGroupInfo().setAsSequence();
                else
                    classInfo.getGroupInfo().setAsAll();
            } catch (ClassCastException ce) {
                //--Should not happen
                throw new IllegalArgumentException("Illegal binding component:"+ce.getMessage());
            }
        }

        //6--createGroupItem
        if (createGroupItem) {
        //-- create Bound Properties code
        if (component.hasBoundProperties())
            createPropertyChangeMethods(jClass);

            sgState.bindReference(jClass, classInfo);

            classes[1] = jClass;

            //-- create main group class
            String fname = component.getJavaClassName() + ITEM_NAME;
            fname  = JavaNaming.toJavaMemberName(fname, false);

            FieldInfo fInfo = null;
            if (createForSingleGroup) {
                //By default a nested group Item can occur only once
                fInfo = infoFactory.createFieldInfo(new XSClass(jClass),
                                                                fname);
            } else {
                fInfo = infoFactory.createCollection(new XSClass(jClass),
                                                            "_items", fname);
            }
            fInfo.setContainer(true);
            className = className.substring(0,className.length()-4);
            state     = new FactoryState(className, sgState, packageName);
View Full Code Here

Examples of org.exolab.castor.builder.types.XSClass

        //-- process annotation
        String comment  = processAnnotations(simpleType);
        if (comment != null)
            jClass.getJDocComment().setComment(comment);

        XSClass xsClass = new XSClass(jClass, typeName);

        classInfo.setSchemaType(xsClass);

        //-- handle enumerated types
        if (enumeration) {
            xsClass.setAsEnumerated(true);
            processEnumeration(simpleType, state);
        }

    //-- create Bound Properties code
    if (state.hasBoundProperties())
View Full Code Here

Examples of org.exolab.castor.builder.types.XSClass

        component.setView(complexType);
       
        String typeName = component.getXMLName();

        ClassInfo classInfo = state.classInfo;
        classInfo.setSchemaType(new XSClass(state.jClass, typeName));

        /// I don't believe this should be here: kv 20030423
        ///classInfo.setNamespaceURI(component.getTargetNamespace());

        //- Handle derived types
View Full Code Here

Examples of org.exolab.castor.builder.types.XSClass

        XSType result = null;
        boolean useWrapper = useWrapper();
        XMLType type = getXMLType();

        if (type.isComplexType()) {
            result = new XSClass(new JClass(getJavaClassName()));
        }
        else {
            if (_type == MEMBER) {
                String javaType = _member.getJavaType();
                if (javaType != null && javaType.length() >0 )
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.