Package org.exolab.javasource

Examples of org.exolab.javasource.JClass


    public XSLong(final boolean asWrapper) {
        super();
       
        _asWrapper = asWrapper;
        if (_asWrapper) {
            _jType = new JClass("java.lang.Long");
        } else {
            _jType = JType.LONG;
        }

        setMinInclusive(MIN_VALUE);
View Full Code Here


    public XSUnsignedShort(final boolean asWrapper) {
        super();
       
        _asWrapper = asWrapper;
        if (_asWrapper) {
            _jType = new JClass("java.lang.Integer");
        } else {
            _jType = JType.INT;
        }
       
        setMinInclusive(MIN_VALUE);
View Full Code Here

    public XSFloat(final boolean asWrapper) {
        super();
       
        _asWrapper = asWrapper;
        if (_asWrapper) {
            _jType = new JClass("java.lang.Float");
        } else {
            _jType = JType.FLOAT;
        }

        setMinInclusive(MIN_VALUE);
View Full Code Here

    public XSNegativeInteger(final boolean asWrapper) {
        super();
       
        _asWrapper = asWrapper;
        if (_asWrapper) {
            _jType = new JClass("java.lang.Long");
        } else {
            _jType = JType.LONG;
        }
       
        setMaxInclusive(MAX_VALUE);
View Full Code Here

    public XSShort(final boolean asWrapper) {
        super();
       
        _asWrapper = asWrapper;
        if (asWrapper) {
            _jType = new JClass("java.lang.Short");
        } else {
            _jType = JType.SHORT;
        }
       
        setMinInclusive(MIN_VALUE);
View Full Code Here

            _jType = new JCollectionType("java.util.SortedSet", "java.util.TreeSet",
                    contentType.getJType(), useJava50);
        } else if (colType.equalsIgnoreCase(SourceGeneratorConstants.FIELD_INFO_VECTOR)) {
            _jType = new JCollectionType("java.util.Vector", contentType.getJType(), useJava50);
        } else if (colType.equalsIgnoreCase(SourceGeneratorConstants.FIELD_INFO_ODMG)) {
            _jType = new JClass("org.odmg.DArray");
        } else {
            _jType = null;
        }
    }
View Full Code Here

        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

        //an imported schema to prevent class creation
        //////////////////////////////////////////////////////

        //4-- intialization of the JClass
        ClassInfo classInfo = state.classInfo;
        JClass    jClass    = state.jClass;
        initialize(jClass);

        //-- name information
        classInfo.setNodeName(component.getXMLName());

        //-- namespace information
        classInfo.setNamespaceURI(component.getTargetNamespace());

        //5--processing the type
        XMLType type = component.getXMLType();
        boolean createForSingleGroup = false;
        boolean creatingForAnElement = false;
       
        if (type != null) {

            //5a--the type is a complexType
            if (type.isComplexType()) {

                creatingForAnElement =
                   (component.getAnnotated().getStructureType() == Structure.ELEMENT);
                ComplexType complexType = (ComplexType)type;
                if (complexType.isTopLevel() && creatingForAnElement) {
                     //--move the view and keep the structure
                     Annotated saved = component.getAnnotated();
                     String previousPackage = component.getJavaPackage();
                     XMLBindingComponent baseComponent = new XMLBindingComponent(_config);
                     baseComponent.setBinding(component.getBinding());
                     baseComponent.setView(complexType);
                     String baseClassName = null;
                     String basePackage = baseComponent.getJavaPackage();
                     //--if the base class is not in the same package
                     //--of the current class then we have to qualify the base
                     //--class
                     if (basePackage != null && !basePackage.equals(previousPackage)) {
                         baseClassName = baseComponent.getQualifiedName();
                         if (baseClassName.indexOf('.') == -1) {
                             //--be sure it is a valid className
                             baseClassName = JavaNaming.toJavaClassName(baseClassName);
                         }
                     } else {
                         baseClassName = baseComponent.getJavaClassName();
                     }
                     jClass.setSuperClass(baseClassName);
                     basePackage = null;
                     baseClassName = null;
                     component.setView(saved);
                     saved = null;
                }
                //generate class if the complexType is anonymous and we create classes
                //for an element OR if the complexType is top-level and we create
                //classes for it.
                else if (complexType.isTopLevel() || creatingForAnElement) {

                    //-- check Group type
                    if (complexType.getParticleCount() == 1) {
                        Particle particle = complexType.getParticle(0);
                        if (particle.getStructureType() == Structure.GROUP) {
                            Group group = (Group) particle;
                            if (group.getOrder() == Order.choice) {
                                classInfo.getGroupInfo().setAsChoice();
                            }
                        }
                    }
                    Annotated saved = component.getAnnotated();
                    processComplexType(complexType, state);
                    component.setView(saved);
                    saved = null;
                }
            }

            //--5b the type is a simpleType
            else if (type.isSimpleType()) {
                SimpleType simpleType = (SimpleType)type;
                //-- handle our special case for enumerated types
                if (simpleType.hasFacet(Facet.ENUMERATION)) {
                   
            //-- Don't create source code for simple types that
            //-- don't belong in the elements target namespace
            String tns = simpleType.getSchema().getTargetNamespace();
            boolean create = false;
            if (tns == null)
                create = (component.getTargetNamespace() == null);
            else
                        create = tns.equals(component.getTargetNamespace());
                       
                       
                    if (create) {
                        ClassInfo tmpInfo = sgState.resolve(simpleType);
                        JClass tmpClass = null;
                        if (tmpInfo != null) {
                            tmpClass = tmpInfo.getJClass();
                        }
                        else {
                  tmpClass = createSourceCode(simpleType, sgState);
View Full Code Here

        FactoryState state = new FactoryState(className, sgState, packageName);
        state.setParent(sgState.getCurrentFactoryState());
       
       
        ClassInfo classInfo = state.classInfo;
        JClass    jClass    = state.jClass;

        initialize(jClass);

        //-- XML information
        Schema  schema = simpleType.getSchema();
        classInfo.setNamespaceURI(schema.getTargetNamespace());
        classInfo.setNodeName(typeName);

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

        XSClass xsClass = new XSClass(jClass, typeName);

        classInfo.setSchemaType(xsClass);
View Full Code Here

        //-----------------------------/
        //- addPropertyChangeListener -/
        //-----------------------------/

        JType jType = new JClass("java.beans.PropertyChangeListener");
        jMethod = new JMethod(null,"addPropertyChangeListener");

        desc = "Registers a PropertyChangeListener with this class.";

        jdc = jMethod.getJDocComment();
View Full Code Here

TOP

Related Classes of org.exolab.javasource.JClass

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.