Package org.jibx.schema.elements

Examples of org.jibx.schema.elements.CommonTypeDefinition


     */
    public CommonTypeDefinition findType(QName qname) {
        if (IComponent.SCHEMA_NAMESPACE.equals(qname.getUri())) {
            return SchemaTypes.getSchemaType(qname.getName());
        } else {
            CommonTypeDefinition type = (CommonTypeDefinition)m_globalTypeMap.get(qname);
            if (type == null && m_importedTypeMap != null) {
                type = (CommonTypeDefinition)m_importedTypeMap.get(qname);
            }
            return type;
        }
View Full Code Here


     *
     * @param node
     * @return <code>true</code> to continue expansion
     */
    public boolean visit(ComplexExtensionElement node) {
        CommonTypeDefinition base = node.getBaseType();
        if (base != SchemaTypes.ANY_TYPE) {
            addReference(node, base);
        }
        return true;
    }
View Full Code Here

     *
     * @param node
     * @return <code>false</code> to end expansion
     */
    public boolean visit(ComplexRestrictionElement node) {
        CommonTypeDefinition base = node.getBaseType();
        if (base != SchemaTypes.ANY_TYPE) {
            addReference(node, base);
        }
        return false;
    }
View Full Code Here

     *
     * @param node
     * @return <code>false</code> to block further expansion
     */
    public boolean visit(SimpleRestrictionElement node) {
        CommonTypeDefinition type = node.getBaseType();
        if (type == null) {
            buildStructure(false, node.getDerivation());
        } else {
            addTypeRefItem(node, type);
        }
View Full Code Here

    public boolean visit(UnionElement node) {
        GroupItem struct = buildStructure(false, node);
        CommonTypeDefinition[] types = node.getMemberTypeDefinitions();
        if (types != null) {
            for (int i = 0; i < types.length; i++) {
                CommonTypeDefinition type = types[i];
                if (type.isPredefinedType()) {
                    struct.addValue(node, type.getQName(), getSchemaType(type));
                } else {
                    GroupItem hold = m_group;
                    m_group = struct;
                    addReference(node, type);
                    m_group = hold;
View Full Code Here

        if (repl != type && s_logger.isDebugEnabled()) {
            s_logger.debug("Replacing type " + type + " with type " + repl + " in component " +
                SchemaUtils.describeComponent(getComponent()));
        }
        while (repl != null) {
            CommonTypeDefinition def = vctx.findType(repl);
            if (def == null) {
               
                // try substituting the original namespace, to work with no-namespace schemas
                if (repl.getUri() == null && type.getUri() != null) {
                    repl = new QName(type.getUri(), repl.getName());
                    def = vctx.findType(repl);
                }
                if (def == null) {
                    throw new IllegalStateException("Internal error - type definition not found");
                }
            }
            GlobalExtension exten = (GlobalExtension)def.getExtension();
            if (exten == null) {
                if (s_logger.isDebugEnabled()) {
                    s_logger.debug("No extension found for referenced type " + SchemaUtils.describeComponent(def));
                }
                return repl;
View Full Code Here

     *
     * @param qname name
     * @param def attribute definition
     */
    public void registerType(QName qname, CommonTypeDefinition def) {
        CommonTypeDefinition dupl = m_nameRegister.registerType(qname, def);
        if (dupl != null) {
            addError("Duplicate name " + qname, def);
        }
    }
View Full Code Here

TOP

Related Classes of org.jibx.schema.elements.CommonTypeDefinition

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.