com.sun.org.apache.xerces.internal.impl.xs.XSComplexTypeDecl Java Examples

The following examples show how to use com.sun.org.apache.xerces.internal.impl.xs.XSComplexTypeDecl. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: XSDComplexTypeTraverser.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private void handleComplexTypeError(String messageId,Object[] args,
        Element e) {

    if (messageId!=null) {
        reportSchemaError(messageId, args, e);
    }

    //
    //  Mock up the typeInfo structure so that there won't be problems during
    //  validation
    //
    fBaseType = SchemaGrammar.fAnyType;
    fContentType = XSComplexTypeDecl.CONTENTTYPE_MIXED;
    fXSSimpleType = null;
    fParticle = getErrorContent();
    // REVISIT: do we need to remove all attribute uses already added into
    // the attribute group? maybe it's ok to leave them there. -SG
    fAttrGrp.fAttributeWC = getErrorWildcard();

    return;

}
 
Example #2
Source File: XSDComplexTypeTraverser.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
private void contentRestore() {
    fAnnotations = (XSAnnotationImpl [])fGlobalStore[--fGlobalStorePos];
    fXSSimpleType = (XSSimpleType)fGlobalStore[--fGlobalStorePos];
    fParticle = (XSParticleDecl)fGlobalStore[--fGlobalStorePos];
    fAttrGrp = (XSAttributeGroupDecl)fGlobalStore[--fGlobalStorePos];
    fBaseType = (XSTypeDefinition)fGlobalStore[--fGlobalStorePos];
    int i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
    fBlock = (short)(i >> 16);
    fContentType = (short)i;
    i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
    fDerivedBy = (short)(i >> 16);
    fFinal = (short)i;
    fTargetNamespace = (String)fGlobalStore[--fGlobalStorePos];
    fName = (String)fGlobalStore[--fGlobalStorePos];
    fIsAbstract = ((Boolean)fGlobalStore[--fGlobalStorePos]).booleanValue();
    fComplexTypeDecl = (XSComplexTypeDecl)fGlobalStore[--fGlobalStorePos];
}
 
Example #3
Source File: XSDComplexTypeTraverser.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private void contentRestore() {
    fAnnotations = (XSAnnotationImpl [])fGlobalStore[--fGlobalStorePos];
    fXSSimpleType = (XSSimpleType)fGlobalStore[--fGlobalStorePos];
    fParticle = (XSParticleDecl)fGlobalStore[--fGlobalStorePos];
    fAttrGrp = (XSAttributeGroupDecl)fGlobalStore[--fGlobalStorePos];
    fBaseType = (XSTypeDefinition)fGlobalStore[--fGlobalStorePos];
    int i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
    fBlock = (short)(i >> 16);
    fContentType = (short)i;
    i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
    fDerivedBy = (short)(i >> 16);
    fFinal = (short)i;
    fTargetNamespace = (String)fGlobalStore[--fGlobalStorePos];
    fName = (String)fGlobalStore[--fGlobalStorePos];
    fIsAbstract = ((Boolean)fGlobalStore[--fGlobalStorePos]).booleanValue();
    fComplexTypeDecl = (XSComplexTypeDecl)fGlobalStore[--fGlobalStorePos];
}
 
Example #4
Source File: XSDComplexTypeTraverser.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Traverse local complexType declarations
 *
 * @param Element
 * @param XSDocumentInfo
 * @param SchemaGrammar
 * @return XSComplexTypeDecl
 */
XSComplexTypeDecl traverseLocal(Element complexTypeNode,
        XSDocumentInfo schemaDoc,
        SchemaGrammar grammar) {


    Object[] attrValues = fAttrChecker.checkAttributes(complexTypeNode, false,
            schemaDoc);
    String complexTypeName = genAnonTypeName(complexTypeNode);
    contentBackup();
    XSComplexTypeDecl type = traverseComplexTypeDecl (complexTypeNode,
            complexTypeName, attrValues, schemaDoc, grammar);
    contentRestore();
    // need to add the type to the grammar for later constraint checking
    grammar.addComplexTypeDecl(type, fSchemaHandler.element2Locator(complexTypeNode));
    type.setIsAnonymous();
    fAttrChecker.returnAttrArray(attrValues, schemaDoc);

    return type;
}
 
Example #5
Source File: XSDComplexTypeTraverser.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private void handleComplexTypeError(String messageId,Object[] args,
        Element e) {

    if (messageId!=null) {
        reportSchemaError(messageId, args, e);
    }

    //
    //  Mock up the typeInfo structure so that there won't be problems during
    //  validation
    //
    fBaseType = SchemaGrammar.fAnyType;
    fContentType = XSComplexTypeDecl.CONTENTTYPE_MIXED;
    fXSSimpleType = null;
    fParticle = getErrorContent();
    // REVISIT: do we need to remove all attribute uses already added into
    // the attribute group? maybe it's ok to leave them there. -SG
    fAttrGrp.fAttributeWC = getErrorWildcard();

    return;

}
 
Example #6
Source File: XSDComplexTypeTraverser.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private void contentRestore() {
    fAnnotations = (XSAnnotationImpl [])fGlobalStore[--fGlobalStorePos];
    fXSSimpleType = (XSSimpleType)fGlobalStore[--fGlobalStorePos];
    fParticle = (XSParticleDecl)fGlobalStore[--fGlobalStorePos];
    fAttrGrp = (XSAttributeGroupDecl)fGlobalStore[--fGlobalStorePos];
    fBaseType = (XSTypeDefinition)fGlobalStore[--fGlobalStorePos];
    int i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
    fBlock = (short)(i >> 16);
    fContentType = (short)i;
    i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
    fDerivedBy = (short)(i >> 16);
    fFinal = (short)i;
    fTargetNamespace = (String)fGlobalStore[--fGlobalStorePos];
    fName = (String)fGlobalStore[--fGlobalStorePos];
    fIsAbstract = ((Boolean)fGlobalStore[--fGlobalStorePos]).booleanValue();
    fComplexTypeDecl = (XSComplexTypeDecl)fGlobalStore[--fGlobalStorePos];
}
 
Example #7
Source File: XSDComplexTypeTraverser.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Traverse local complexType declarations
 *
 * @param Element
 * @param XSDocumentInfo
 * @param SchemaGrammar
 * @return XSComplexTypeDecl
 */
XSComplexTypeDecl traverseLocal(Element complexTypeNode,
        XSDocumentInfo schemaDoc,
        SchemaGrammar grammar) {


    Object[] attrValues = fAttrChecker.checkAttributes(complexTypeNode, false,
            schemaDoc);
    String complexTypeName = genAnonTypeName(complexTypeNode);
    contentBackup();
    XSComplexTypeDecl type = traverseComplexTypeDecl (complexTypeNode,
            complexTypeName, attrValues, schemaDoc, grammar);
    contentRestore();
    // need to add the type to the grammar for later constraint checking
    grammar.addComplexTypeDecl(type, fSchemaHandler.element2Locator(complexTypeNode));
    type.setIsAnonymous();
    fAttrChecker.returnAttrArray(attrValues, schemaDoc);

    return type;
}
 
Example #8
Source File: XSDComplexTypeTraverser.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private void contentRestore() {
    fAnnotations = (XSAnnotationImpl [])fGlobalStore[--fGlobalStorePos];
    fXSSimpleType = (XSSimpleType)fGlobalStore[--fGlobalStorePos];
    fParticle = (XSParticleDecl)fGlobalStore[--fGlobalStorePos];
    fAttrGrp = (XSAttributeGroupDecl)fGlobalStore[--fGlobalStorePos];
    fBaseType = (XSTypeDefinition)fGlobalStore[--fGlobalStorePos];
    int i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
    fBlock = (short)(i >> 16);
    fContentType = (short)i;
    i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
    fDerivedBy = (short)(i >> 16);
    fFinal = (short)i;
    fTargetNamespace = (String)fGlobalStore[--fGlobalStorePos];
    fName = (String)fGlobalStore[--fGlobalStorePos];
    fIsAbstract = ((Boolean)fGlobalStore[--fGlobalStorePos]).booleanValue();
    fComplexTypeDecl = (XSComplexTypeDecl)fGlobalStore[--fGlobalStorePos];
}
 
Example #9
Source File: XSDComplexTypeTraverser.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private void handleComplexTypeError(String messageId,Object[] args,
        Element e) {

    if (messageId!=null) {
        reportSchemaError(messageId, args, e);
    }

    //
    //  Mock up the typeInfo structure so that there won't be problems during
    //  validation
    //
    fBaseType = SchemaGrammar.fAnyType;
    fContentType = XSComplexTypeDecl.CONTENTTYPE_MIXED;
    fXSSimpleType = null;
    fParticle = getErrorContent();
    // REVISIT: do we need to remove all attribute uses already added into
    // the attribute group? maybe it's ok to leave them there. -SG
    fAttrGrp.fAttributeWC = getErrorWildcard();

    return;

}
 
Example #10
Source File: ElementNSImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Introduced in DOM Level 2. <p>
 * Checks if a type is derived from another by restriction. See:
 * http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-isDerivedFrom
 *
 * @param ancestorNS
 *        The namspace of the ancestor type declaration
 * @param ancestorName
 *        The name of the ancestor type declaration
 * @param type
 *        The reference type definition
 *
 * @return boolean True if the type is derived by restriciton for the
 *         reference type
 */
public boolean isDerivedFrom(String typeNamespaceArg, String typeNameArg,
        int derivationMethod) {
    if(needsSyncData()) {
        synchronizeData();
    }
    if (type != null) {
        if (type instanceof XSSimpleTypeDecl) {
            return ((XSSimpleTypeDecl) type).isDOMDerivedFrom(
                    typeNamespaceArg, typeNameArg, derivationMethod);
        } else if (type instanceof XSComplexTypeDecl) {
            return ((XSComplexTypeDecl) type).isDOMDerivedFrom(
                    typeNamespaceArg, typeNameArg, derivationMethod);
        }
    }
    return false;
}
 
Example #11
Source File: ElementNSImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Introduced in DOM Level 2. <p>
 * Checks if a type is derived from another by restriction. See:
 * http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-isDerivedFrom
 *
 * @param ancestorNS
 *        The namspace of the ancestor type declaration
 * @param ancestorName
 *        The name of the ancestor type declaration
 * @param type
 *        The reference type definition
 *
 * @return boolean True if the type is derived by restriciton for the
 *         reference type
 */
public boolean isDerivedFrom(String typeNamespaceArg, String typeNameArg,
        int derivationMethod) {
    if(needsSyncData()) {
        synchronizeData();
    }
    if (type != null) {
        if (type instanceof XSSimpleTypeDecl) {
            return ((XSSimpleTypeDecl) type).isDOMDerivedFrom(
                    typeNamespaceArg, typeNameArg, derivationMethod);
        } else if (type instanceof XSComplexTypeDecl) {
            return ((XSComplexTypeDecl) type).isDOMDerivedFrom(
                    typeNamespaceArg, typeNameArg, derivationMethod);
        }
    }
    return false;
}
 
Example #12
Source File: XSDComplexTypeTraverser.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Traverse local complexType declarations
 *
 * @param Element
 * @param XSDocumentInfo
 * @param SchemaGrammar
 * @return XSComplexTypeDecl
 */
XSComplexTypeDecl traverseLocal(Element complexTypeNode,
        XSDocumentInfo schemaDoc,
        SchemaGrammar grammar) {


    Object[] attrValues = fAttrChecker.checkAttributes(complexTypeNode, false,
            schemaDoc);
    String complexTypeName = genAnonTypeName(complexTypeNode);
    contentBackup();
    XSComplexTypeDecl type = traverseComplexTypeDecl (complexTypeNode,
            complexTypeName, attrValues, schemaDoc, grammar);
    contentRestore();
    // need to add the type to the grammar for later constraint checking
    grammar.addComplexTypeDecl(type, fSchemaHandler.element2Locator(complexTypeNode));
    type.setIsAnonymous();
    fAttrChecker.returnAttrArray(attrValues, schemaDoc);

    return type;
}
 
Example #13
Source File: XSDComplexTypeTraverser.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
private void handleComplexTypeError(String messageId,Object[] args,
        Element e) {

    if (messageId!=null) {
        reportSchemaError(messageId, args, e);
    }

    //
    //  Mock up the typeInfo structure so that there won't be problems during
    //  validation
    //
    fBaseType = SchemaGrammar.fAnyType;
    fContentType = XSComplexTypeDecl.CONTENTTYPE_MIXED;
    fXSSimpleType = null;
    fParticle = getErrorContent();
    // REVISIT: do we need to remove all attribute uses already added into
    // the attribute group? maybe it's ok to leave them there. -SG
    fAttrGrp.fAttributeWC = getErrorWildcard();

    return;

}
 
Example #14
Source File: XSDComplexTypeTraverser.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
private void contentRestore() {
    fAnnotations = (XSAnnotationImpl [])fGlobalStore[--fGlobalStorePos];
    fXSSimpleType = (XSSimpleType)fGlobalStore[--fGlobalStorePos];
    fParticle = (XSParticleDecl)fGlobalStore[--fGlobalStorePos];
    fAttrGrp = (XSAttributeGroupDecl)fGlobalStore[--fGlobalStorePos];
    fBaseType = (XSTypeDefinition)fGlobalStore[--fGlobalStorePos];
    int i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
    fBlock = (short)(i >> 16);
    fContentType = (short)i;
    i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
    fDerivedBy = (short)(i >> 16);
    fFinal = (short)i;
    fTargetNamespace = (String)fGlobalStore[--fGlobalStorePos];
    fName = (String)fGlobalStore[--fGlobalStorePos];
    fIsAbstract = ((Boolean)fGlobalStore[--fGlobalStorePos]).booleanValue();
    fComplexTypeDecl = (XSComplexTypeDecl)fGlobalStore[--fGlobalStorePos];
}
 
Example #15
Source File: Xsd2Raml.java    From mule-intellij-plugins with Apache License 2.0 6 votes vote down vote up
public String getRamlTypes() {
    StringBuffer ramlTypesBuffer = new StringBuffer();

    for (int idx = 0; idx < typeDefs.getLength(); idx++) {
        XSTypeDefinition nextType = (XSTypeDefinition)typeDefs.item(idx);
        //System.out.println("NEXT TYPE IS " + nextType);
        if (!URI_2001_SCHEMA_XSD.equals(nextType.getNamespace())) {
            if (nextType.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
                ramlTypesBuffer.append(doConvertSimpleType((XSSimpleType) nextType));
            } else {
                ramlTypesBuffer.append(doConvertComplexType((XSComplexTypeDecl) nextType));
            }
        }
    }

    return ramlTypesBuffer.toString();
}
 
Example #16
Source File: ElementNSImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Introduced in DOM Level 2. <p>
 * Checks if a type is derived from another by restriction. See:
 * http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-isDerivedFrom
 *
 * @param ancestorNS
 *        The namspace of the ancestor type declaration
 * @param ancestorName
 *        The name of the ancestor type declaration
 * @param type
 *        The reference type definition
 *
 * @return boolean True if the type is derived by restriciton for the
 *         reference type
 */
public boolean isDerivedFrom(String typeNamespaceArg, String typeNameArg,
        int derivationMethod) {
    if(needsSyncData()) {
        synchronizeData();
    }
    if (type != null) {
        if (type instanceof XSSimpleTypeDecl) {
            return ((XSSimpleTypeDecl) type).isDOMDerivedFrom(
                    typeNamespaceArg, typeNameArg, derivationMethod);
        } else if (type instanceof XSComplexTypeDecl) {
            return ((XSComplexTypeDecl) type).isDOMDerivedFrom(
                    typeNamespaceArg, typeNameArg, derivationMethod);
        }
    }
    return false;
}
 
Example #17
Source File: XSDComplexTypeTraverser.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Traverse local complexType declarations
 *
 * @param Element
 * @param XSDocumentInfo
 * @param SchemaGrammar
 * @return XSComplexTypeDecl
 */
XSComplexTypeDecl traverseLocal(Element complexTypeNode,
        XSDocumentInfo schemaDoc,
        SchemaGrammar grammar) {


    Object[] attrValues = fAttrChecker.checkAttributes(complexTypeNode, false,
            schemaDoc);
    String complexTypeName = genAnonTypeName(complexTypeNode);
    contentBackup();
    XSComplexTypeDecl type = traverseComplexTypeDecl (complexTypeNode,
            complexTypeName, attrValues, schemaDoc, grammar);
    contentRestore();
    // need to add the type to the grammar for later constraint checking
    grammar.addComplexTypeDecl(type, fSchemaHandler.element2Locator(complexTypeNode));
    type.setIsAnonymous();
    fAttrChecker.returnAttrArray(attrValues, schemaDoc);

    return type;
}
 
Example #18
Source File: XSDComplexTypeTraverser.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private void handleComplexTypeError(String messageId,Object[] args,
        Element e) {

    if (messageId!=null) {
        reportSchemaError(messageId, args, e);
    }

    //
    //  Mock up the typeInfo structure so that there won't be problems during
    //  validation
    //
    fBaseType = SchemaGrammar.fAnyType;
    fContentType = XSComplexTypeDecl.CONTENTTYPE_MIXED;
    fXSSimpleType = null;
    fParticle = getErrorContent();
    // REVISIT: do we need to remove all attribute uses already added into
    // the attribute group? maybe it's ok to leave them there. -SG
    fAttrGrp.fAttributeWC = getErrorWildcard();

    return;

}
 
Example #19
Source File: XSDComplexTypeTraverser.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private void contentRestore() {
    fAnnotations = (XSAnnotationImpl [])fGlobalStore[--fGlobalStorePos];
    fXSSimpleType = (XSSimpleType)fGlobalStore[--fGlobalStorePos];
    fParticle = (XSParticleDecl)fGlobalStore[--fGlobalStorePos];
    fAttrGrp = (XSAttributeGroupDecl)fGlobalStore[--fGlobalStorePos];
    fBaseType = (XSTypeDefinition)fGlobalStore[--fGlobalStorePos];
    int i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
    fBlock = (short)(i >> 16);
    fContentType = (short)i;
    i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
    fDerivedBy = (short)(i >> 16);
    fFinal = (short)i;
    fTargetNamespace = (String)fGlobalStore[--fGlobalStorePos];
    fName = (String)fGlobalStore[--fGlobalStorePos];
    fIsAbstract = ((Boolean)fGlobalStore[--fGlobalStorePos]).booleanValue();
    fComplexTypeDecl = (XSComplexTypeDecl)fGlobalStore[--fGlobalStorePos];
}
 
Example #20
Source File: XSDComplexTypeTraverser.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private void handleComplexTypeError(String messageId,Object[] args,
        Element e) {

    if (messageId!=null) {
        reportSchemaError(messageId, args, e);
    }

    //
    //  Mock up the typeInfo structure so that there won't be problems during
    //  validation
    //
    fBaseType = SchemaGrammar.fAnyType;
    fContentType = XSComplexTypeDecl.CONTENTTYPE_MIXED;
    fXSSimpleType = null;
    fParticle = getErrorContent();
    // REVISIT: do we need to remove all attribute uses already added into
    // the attribute group? maybe it's ok to leave them there. -SG
    fAttrGrp.fAttributeWC = getErrorWildcard();

    return;

}
 
Example #21
Source File: ElementNSImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Introduced in DOM Level 2. <p>
 * Checks if a type is derived from another by restriction. See:
 * http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-isDerivedFrom
 *
 * @param ancestorNS
 *        The namspace of the ancestor type declaration
 * @param ancestorName
 *        The name of the ancestor type declaration
 * @param type
 *        The reference type definition
 *
 * @return boolean True if the type is derived by restriciton for the
 *         reference type
 */
public boolean isDerivedFrom(String typeNamespaceArg, String typeNameArg,
        int derivationMethod) {
    if(needsSyncData()) {
        synchronizeData();
    }
    if (type != null) {
        if (type instanceof XSSimpleTypeDecl) {
            return ((XSSimpleTypeDecl) type).isDOMDerivedFrom(
                    typeNamespaceArg, typeNameArg, derivationMethod);
        } else if (type instanceof XSComplexTypeDecl) {
            return ((XSComplexTypeDecl) type).isDOMDerivedFrom(
                    typeNamespaceArg, typeNameArg, derivationMethod);
        }
    }
    return false;
}
 
Example #22
Source File: XSDComplexTypeTraverser.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Traverse local complexType declarations
 *
 * @param Element
 * @param XSDocumentInfo
 * @param SchemaGrammar
 * @return XSComplexTypeDecl
 */
XSComplexTypeDecl traverseLocal(Element complexTypeNode,
        XSDocumentInfo schemaDoc,
        SchemaGrammar grammar) {


    Object[] attrValues = fAttrChecker.checkAttributes(complexTypeNode, false,
            schemaDoc);
    String complexTypeName = genAnonTypeName(complexTypeNode);
    contentBackup();
    XSComplexTypeDecl type = traverseComplexTypeDecl (complexTypeNode,
            complexTypeName, attrValues, schemaDoc, grammar);
    contentRestore();
    // need to add the type to the grammar for later constraint checking
    grammar.addComplexTypeDecl(type, fSchemaHandler.element2Locator(complexTypeNode));
    type.setIsAnonymous();
    fAttrChecker.returnAttrArray(attrValues, schemaDoc);

    return type;
}
 
Example #23
Source File: XSDComplexTypeTraverser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Traverse local complexType declarations
 *
 * @param Element
 * @param XSDocumentInfo
 * @param SchemaGrammar
 * @return XSComplexTypeDecl
 */
XSComplexTypeDecl traverseLocal(Element complexTypeNode,
        XSDocumentInfo schemaDoc,
        SchemaGrammar grammar) {


    Object[] attrValues = fAttrChecker.checkAttributes(complexTypeNode, false,
            schemaDoc);
    String complexTypeName = genAnonTypeName(complexTypeNode);
    contentBackup();
    XSComplexTypeDecl type = traverseComplexTypeDecl (complexTypeNode,
            complexTypeName, attrValues, schemaDoc, grammar);
    contentRestore();
    // need to add the type to the grammar for later constraint checking
    grammar.addComplexTypeDecl(type, fSchemaHandler.element2Locator(complexTypeNode));
    type.setIsAnonymous();
    fAttrChecker.returnAttrArray(attrValues, schemaDoc);

    return type;
}
 
Example #24
Source File: XSDComplexTypeTraverser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private void handleComplexTypeError(String messageId,Object[] args,
        Element e) {

    if (messageId!=null) {
        reportSchemaError(messageId, args, e);
    }

    //
    //  Mock up the typeInfo structure so that there won't be problems during
    //  validation
    //
    fBaseType = SchemaGrammar.fAnyType;
    fContentType = XSComplexTypeDecl.CONTENTTYPE_MIXED;
    fXSSimpleType = null;
    fParticle = getErrorContent();
    // REVISIT: do we need to remove all attribute uses already added into
    // the attribute group? maybe it's ok to leave them there. -SG
    fAttrGrp.fAttributeWC = getErrorWildcard();

    return;

}
 
Example #25
Source File: XSDComplexTypeTraverser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private void contentRestore() {
    fAnnotations = (XSAnnotationImpl [])fGlobalStore[--fGlobalStorePos];
    fXSSimpleType = (XSSimpleType)fGlobalStore[--fGlobalStorePos];
    fParticle = (XSParticleDecl)fGlobalStore[--fGlobalStorePos];
    fAttrGrp = (XSAttributeGroupDecl)fGlobalStore[--fGlobalStorePos];
    fBaseType = (XSTypeDefinition)fGlobalStore[--fGlobalStorePos];
    int i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
    fBlock = (short)(i >> 16);
    fContentType = (short)i;
    i = ((Integer)(fGlobalStore[--fGlobalStorePos])).intValue();
    fDerivedBy = (short)(i >> 16);
    fFinal = (short)i;
    fTargetNamespace = (String)fGlobalStore[--fGlobalStorePos];
    fName = (String)fGlobalStore[--fGlobalStorePos];
    fIsAbstract = ((Boolean)fGlobalStore[--fGlobalStorePos]).booleanValue();
    fComplexTypeDecl = (XSComplexTypeDecl)fGlobalStore[--fGlobalStorePos];
}
 
Example #26
Source File: ElementNSImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Introduced in DOM Level 2. <p>
 * Checks if a type is derived from another by restriction. See:
 * http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-isDerivedFrom
 *
 * @param ancestorNS
 *        The namspace of the ancestor type declaration
 * @param ancestorName
 *        The name of the ancestor type declaration
 * @param type
 *        The reference type definition
 *
 * @return boolean True if the type is derived by restriciton for the
 *         reference type
 */
public boolean isDerivedFrom(String typeNamespaceArg, String typeNameArg,
        int derivationMethod) {
    if(needsSyncData()) {
        synchronizeData();
    }
    if (type != null) {
        if (type instanceof XSSimpleTypeDecl) {
            return ((XSSimpleTypeDecl) type).isDOMDerivedFrom(
                    typeNamespaceArg, typeNameArg, derivationMethod);
        } else if (type instanceof XSComplexTypeDecl) {
            return ((XSComplexTypeDecl) type).isDOMDerivedFrom(
                    typeNamespaceArg, typeNameArg, derivationMethod);
        }
    }
    return false;
}
 
Example #27
Source File: ElementNSImpl.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Introduced in DOM Level 2. <p>
 * Checks if a type is derived from another by restriction. See:
 * http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-isDerivedFrom
 *
 * @param typeNamespaceArg
 *        The namspace of the ancestor type declaration
 * @param typeNameArg
 *        The name of the ancestor type declaration
 * @param derivationMethod
 *        The derivation method
 *
 * @return boolean True if the type is derived by restriciton for the
 *         reference type
 */
public boolean isDerivedFrom(String typeNamespaceArg, String typeNameArg,
        int derivationMethod) {
    if(needsSyncData()) {
        synchronizeData();
    }
    if (type != null) {
        if (type instanceof XSSimpleTypeDecl) {
            return ((XSSimpleTypeDecl) type).isDOMDerivedFrom(
                    typeNamespaceArg, typeNameArg, derivationMethod);
        } else if (type instanceof XSComplexTypeDecl) {
            return ((XSComplexTypeDecl) type).isDOMDerivedFrom(
                    typeNamespaceArg, typeNameArg, derivationMethod);
        }
    }
    return false;
}
 
Example #28
Source File: XSDComplexTypeTraverser.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * Traverse local complexType declarations
 *
 * @param Element
 * @param XSDocumentInfo
 * @param SchemaGrammar
 * @return XSComplexTypeDecl
 */
XSComplexTypeDecl traverseLocal(Element complexTypeNode,
        XSDocumentInfo schemaDoc,
        SchemaGrammar grammar) {


    Object[] attrValues = fAttrChecker.checkAttributes(complexTypeNode, false,
            schemaDoc);
    String complexTypeName = genAnonTypeName(complexTypeNode);
    contentBackup();
    XSComplexTypeDecl type = traverseComplexTypeDecl (complexTypeNode,
            complexTypeName, attrValues, schemaDoc, grammar);
    contentRestore();
    // need to add the type to the grammar for later constraint checking
    grammar.addComplexTypeDecl(type, fSchemaHandler.element2Locator(complexTypeNode));
    type.setIsAnonymous();
    fAttrChecker.returnAttrArray(attrValues, schemaDoc);

    return type;
}
 
Example #29
Source File: XSDComplexTypeTraverser.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
private void handleComplexTypeError(String messageId,Object[] args,
        Element e) {

    if (messageId!=null) {
        reportSchemaError(messageId, args, e);
    }

    //
    //  Mock up the typeInfo structure so that there won't be problems during
    //  validation
    //
    fBaseType = SchemaGrammar.fAnyType;
    fContentType = XSComplexTypeDecl.CONTENTTYPE_MIXED;
    fXSSimpleType = null;
    fParticle = getErrorContent();
    // REVISIT: do we need to remove all attribute uses already added into
    // the attribute group? maybe it's ok to leave them there. -SG
    fAttrGrp.fAttributeWC = getErrorWildcard();
}
 
Example #30
Source File: XSDComplexTypeTraverser.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
private void contentRestore() {
    fAnnotations = (XSAnnotationImpl [])fGlobalStore[--fGlobalStorePos];
    fXSSimpleType = (XSSimpleType)fGlobalStore[--fGlobalStorePos];
    fParticle = (XSParticleDecl)fGlobalStore[--fGlobalStorePos];
    fAttrGrp = (XSAttributeGroupDecl)fGlobalStore[--fGlobalStorePos];
    fBaseType = (XSTypeDefinition)fGlobalStore[--fGlobalStorePos];
    int i = ((Integer)(fGlobalStore[--fGlobalStorePos]));
    fBlock = (short)(i >> 16);
    fContentType = (short)i;
    i = ((Integer)(fGlobalStore[--fGlobalStorePos]));
    fDerivedBy = (short)(i >> 16);
    fFinal = (short)i;
    fTargetNamespace = (String)fGlobalStore[--fGlobalStorePos];
    fName = (String)fGlobalStore[--fGlobalStorePos];
    fIsAbstract = ((Boolean)fGlobalStore[--fGlobalStorePos]);
    fComplexTypeDecl = (XSComplexTypeDecl)fGlobalStore[--fGlobalStorePos];
}