Package org.exolab.castor.xml.schema.simpletypes

Examples of org.exolab.castor.xml.schema.simpletypes.ListType


                                           baseType.getName()) );
                return null;
            }
            */
            try {
                result= new ListType(schema);
            }
            catch(SchemaException sx) {
                sendToLog( Messages.format("schema.deriveByListError",
                                           internalName,
                                           baseType.getName()) );
View Full Code Here


    {
        Type type= getType(builtInTypeName);

       //If the type is derived by list, return a new ListType.
        String derivation= type.getDerivedBy();
        ListType resultList = null;
        if ( (derivation != null) && (derivation.equals(SchemaNames.LIST)) ) {
            try {
                resultList = new ListType(schema);
            }
            catch(SchemaException sx) {
                //-- This should not happen...but who knows!
                throw new SimpleTypesFactoryException(sx);
            }
        }

        //Finds the primitive ancestor (defines the class that represents it)
        Class implClass= null;
        while (type != null) {
            if (type.getImplClass() != null) {
                implClass= type.getImplClass();
                break;
            }
            type= getType(type.getBase());
        }

        if (implClass == null) return null;

        SimpleType result;
        if (implClass.isAssignableFrom(UrType.class)) {
                try {
                     result = (UrType)implClass.newInstance();
                     result.setSchema(schema);
                }
                catch (Exception e) {
                    throw new SimpleTypesFactoryException(e);
                }
        }
        else {
             try {
                 result = (AtomicType)implClass.newInstance();
                 result.setSchema(schema);
             }
             catch (Exception except) {
                 except.printStackTrace();
                 result= null;
             }
             if (resultList != null) {
                  resultList.setItemType(result);
                  return resultList;
             }
        }
        return result;
    } //-- createInstance
View Full Code Here

            final AttributeSet atts)
    throws XMLException {
        super(schemaContext);
       
        _schema = schema;
        _list = new ListType(schema);

        //-- itemType
        String itemTypeName = atts.getValue(SchemaNames.ITEM_TYPE_ATTR);
        if ((itemTypeName != null) && (itemTypeName.length() > 0)) {
View Full Code Here

                        }
                    }
                   
                    // handle special case where the list type uses an item type
                    // that has enumeration facets defined.
                    ListType listType = (ListType) simpleType;
                    if (listType == null) {
                        listType = (ListType) baseType;
                    }
                    SimpleType itemType = listType.getItemType();
                    if (itemType.hasFacet(Facet.ENUMERATION)) {
                        ClassInfo itemClassInfo = resolver.resolve(itemType);
                        if (itemClassInfo != null) {
                            xsType = new XMLInfoNature(itemClassInfo).getSchemaType();
                        } else {
View Full Code Here

        throws XMLException
    {
        super();
       
        _schema = schema;
        _list = new ListType(schema);

        //-- itemType
        String itemTypeName = atts.getValue(SchemaNames.ITEM_TYPE_ATTR);
        if ((itemTypeName != null) && (itemTypeName.length() > 0)) {
View Full Code Here

TOP

Related Classes of org.exolab.castor.xml.schema.simpletypes.ListType

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.