com.sun.org.apache.xerces.internal.impl.dv.xs.XSSimpleTypeDecl Java Examples

The following examples show how to use com.sun.org.apache.xerces.internal.impl.dv.xs.XSSimpleTypeDecl. 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: 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 #2
Source File: ElementNSImpl.java    From TencentKona-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 #3
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 #4
Source File: ElementNSImpl.java    From openjdk-jdk8u 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 #5
Source File: ElementNSImpl.java    From jdk8u60 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 #6
Source File: ElementNSImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @see org.w3c.dom.TypeInfo#getTypeName()
 */
public String getTypeName() {
    if (type !=null){
        if (type instanceof XSSimpleTypeDecl) {
            return ((XSSimpleTypeDecl) type).getTypeName();
        } else if (type instanceof XSComplexTypeDecl) {
            return ((XSComplexTypeDecl) type).getTypeName();
        }
    }
    return null;
}
 
Example #7
Source File: XSDeclarationPool.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public final XSSimpleTypeDecl getSimpleTypeDecl(){
    int     chunk       = fSTDeclIndex >> CHUNK_SHIFT;
    int     index       = fSTDeclIndex &  CHUNK_MASK;
    ensureSTDeclCapacity(chunk);
    if (fSTDecl[chunk][index] == null) {
        fSTDecl[chunk][index] = dvFactory.newXSSimpleTypeDecl();
    } else {
        fSTDecl[chunk][index].reset();
    }
    fSTDeclIndex++;
    return fSTDecl[chunk][index];

}
 
Example #8
Source File: XSDHandler.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
private void expandRelatedTypeComponents(XSTypeDefinition type, Vector componentList, String namespace, Map<String, Vector> dependencies) {
    if (type instanceof XSComplexTypeDecl) {
        expandRelatedComplexTypeComponents((XSComplexTypeDecl) type, componentList, namespace, dependencies);
    }
    else if (type instanceof XSSimpleTypeDecl) {
        expandRelatedSimpleTypeComponents((XSSimpleTypeDefinition) type, componentList, namespace, dependencies);
    }
}
 
Example #9
Source File: XSDSimpleTypeTraverser.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
XSSimpleType traverseLocal(Element elmNode,
        XSDocumentInfo schemaDoc,
        SchemaGrammar grammar) {

    // General Attribute Checking
    Object[] attrValues = fAttrChecker.checkAttributes(elmNode, false, schemaDoc);
    String name = genAnonTypeName(elmNode);
    XSSimpleType type = getSimpleType (name, elmNode, attrValues, schemaDoc, grammar);
    if (type instanceof XSSimpleTypeDecl) {
        ((XSSimpleTypeDecl)type).setAnonymous(true);
    }
    fAttrChecker.returnAttrArray(attrValues, schemaDoc);

    return type;
}
 
Example #10
Source File: XSDeclarationPool.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
private boolean ensureSTDeclCapacity(int chunk) {
    if (chunk >= fSTDecl.length) {
        fSTDecl = resize(fSTDecl, fSTDecl.length * 2);
    } else if (fSTDecl[chunk] != null) {
        return false;
    }

    fSTDecl[chunk] = new XSSimpleTypeDecl[CHUNK_SIZE];
    return true;
}
 
Example #11
Source File: AttrNSImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @see org.w3c.dom.TypeInfo#getTypeNamespace()
 */
public String getTypeNamespace() {
    if (type !=null) {
        if (type instanceof XSSimpleTypeDecl){
            return ((XSSimpleTypeDecl)type).getNamespace();
        }
        return DTD_URI;
    }
    return null;
}
 
Example #12
Source File: XSDeclarationPool.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public final XSSimpleTypeDecl getSimpleTypeDecl(){
    int     chunk       = fSTDeclIndex >> CHUNK_SHIFT;
    int     index       = fSTDeclIndex &  CHUNK_MASK;
    ensureSTDeclCapacity(chunk);
    if (fSTDecl[chunk][index] == null) {
        fSTDecl[chunk][index] = dvFactory.newXSSimpleTypeDecl();
    } else {
        fSTDecl[chunk][index].reset();
    }
    fSTDeclIndex++;
    return fSTDecl[chunk][index];

}
 
Example #13
Source File: XSDeclarationPool.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private boolean ensureSTDeclCapacity(int chunk) {
    if (chunk >= fSTDecl.length) {
        fSTDecl = resize(fSTDecl, fSTDecl.length * 2);
    } else if (fSTDecl[chunk] != null) {
        return false;
    }

    fSTDecl[chunk] = new XSSimpleTypeDecl[CHUNK_SIZE];
    return true;
}
 
Example #14
Source File: XSDSimpleTypeTraverser.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
XSSimpleType traverseLocal(Element elmNode,
        XSDocumentInfo schemaDoc,
        SchemaGrammar grammar) {

    // General Attribute Checking
    Object[] attrValues = fAttrChecker.checkAttributes(elmNode, false, schemaDoc);
    String name = genAnonTypeName(elmNode);
    XSSimpleType type = getSimpleType (name, elmNode, attrValues, schemaDoc, grammar);
    if (type instanceof XSSimpleTypeDecl) {
        ((XSSimpleTypeDecl)type).setAnonymous(true);
    }
    fAttrChecker.returnAttrArray(attrValues, schemaDoc);

    return type;
}
 
Example #15
Source File: XSDHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private void expandRelatedTypeComponents(XSTypeDefinition type, Vector componentList, String namespace, Map<String, Vector> dependencies) {
    if (type instanceof XSComplexTypeDecl) {
        expandRelatedComplexTypeComponents((XSComplexTypeDecl) type, componentList, namespace, dependencies);
    }
    else if (type instanceof XSSimpleTypeDecl) {
        expandRelatedSimpleTypeComponents((XSSimpleTypeDefinition) type, componentList, namespace, dependencies);
    }
}
 
Example #16
Source File: SchemaGrammar.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * register one global type
 */
public void addGlobalTypeDecl(XSTypeDefinition decl) {
    fGlobalTypeDecls.put(decl.getName(), decl);
    if (decl instanceof XSComplexTypeDecl) {
        ((XSComplexTypeDecl) decl).setNamespaceItem(this);
    }
    else if (decl instanceof XSSimpleTypeDecl) {
        ((XSSimpleTypeDecl) decl).setNamespaceItem(this);
    }
}
 
Example #17
Source File: ElementNSImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * @see org.w3c.dom.TypeInfo#getTypeName()
 */
public String getTypeName() {
    if (type !=null){
        if (type instanceof XSSimpleTypeDecl) {
            return ((XSSimpleTypeDecl) type).getTypeName();
        } else if (type instanceof XSComplexTypeDecl) {
            return ((XSComplexTypeDecl) type).getTypeName();
        }
    }
    return null;
}
 
Example #18
Source File: ElementNSImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @see org.w3c.dom.TypeInfo#getTypeName()
 */
public String getTypeName() {
    if (type !=null){
        if (type instanceof XSSimpleTypeDecl) {
            return ((XSSimpleTypeDecl) type).getTypeName();
        } else if (type instanceof XSComplexTypeDecl) {
            return ((XSComplexTypeDecl) type).getTypeName();
        }
    }
    return null;
}
 
Example #19
Source File: AttrNSImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @see org.w3c.dom.TypeInfo#getTypeName()
 */
public String getTypeName() {
    if (type !=null){
        if (type instanceof XSSimpleTypeDecl){
            return ((XSSimpleTypeDecl)type).getName();
        }
        return (String)type;
    }
    return null;
}
 
Example #20
Source File: AttrNSImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * @see org.w3c.dom.TypeInfo#getTypeName()
 */
public String getTypeName() {
    if (type !=null){
        if (type instanceof XSSimpleTypeDecl){
            return ((XSSimpleTypeDecl)type).getName();
        }
        return (String)type;
    }
    return null;
}
 
Example #21
Source File: SchemaGrammar.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void addGlobalTypeDecl(XSTypeDefinition decl, String location) {
    fGlobalTypeDeclsExt.put(((location!=null) ? location : "") + "," + decl.getName(), decl);
    if (decl.getNamespaceItem() == null) {
        if (decl instanceof XSComplexTypeDecl) {
            ((XSComplexTypeDecl) decl).setNamespaceItem(this);
        }
        else if (decl instanceof XSSimpleTypeDecl) {
            ((XSSimpleTypeDecl) decl).setNamespaceItem(this);
        }
    }
}
 
Example #22
Source File: ElementNSImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * @see org.w3c.dom.TypeInfo#getTypeName()
 */
public String getTypeName() {
    if (type !=null){
        if (type instanceof XSSimpleTypeDecl) {
            return ((XSSimpleTypeDecl) type).getTypeName();
        } else if (type instanceof XSComplexTypeDecl) {
            return ((XSComplexTypeDecl) type).getTypeName();
        }
    }
    return null;
}
 
Example #23
Source File: SchemaGrammar.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * register one global simple type
 */
public void addGlobalSimpleTypeDecl(XSSimpleType decl) {
    fGlobalTypeDecls.put(decl.getName(), decl);
    if (decl instanceof XSSimpleTypeDecl) {
        ((XSSimpleTypeDecl) decl).setNamespaceItem(this);
    }
}
 
Example #24
Source File: SchemaGrammar.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void addGlobalTypeDecl(XSTypeDefinition decl, String location) {
    fGlobalTypeDeclsExt.put(((location!=null) ? location : "") + "," + decl.getName(), decl);
    if (decl.getNamespaceItem() == null) {
        if (decl instanceof XSComplexTypeDecl) {
            ((XSComplexTypeDecl) decl).setNamespaceItem(this);
        }
        else if (decl instanceof XSSimpleTypeDecl) {
            ((XSSimpleTypeDecl) decl).setNamespaceItem(this);
        }
    }
}
 
Example #25
Source File: SchemaGrammar.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * register one global type
 */
public void addGlobalTypeDecl(XSTypeDefinition decl) {
    fGlobalTypeDecls.put(decl.getName(), decl);
    if (decl instanceof XSComplexTypeDecl) {
        ((XSComplexTypeDecl) decl).setNamespaceItem(this);
    }
    else if (decl instanceof XSSimpleTypeDecl) {
        ((XSSimpleTypeDecl) decl).setNamespaceItem(this);
    }
}
 
Example #26
Source File: XSDHandler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private void expandRelatedTypeComponents(XSTypeDefinition type, Vector componentList, String namespace, Map<String, Vector> dependencies) {
    if (type instanceof XSComplexTypeDecl) {
        expandRelatedComplexTypeComponents((XSComplexTypeDecl) type, componentList, namespace, dependencies);
    }
    else if (type instanceof XSSimpleTypeDecl) {
        expandRelatedSimpleTypeComponents((XSSimpleTypeDefinition) type, componentList, namespace, dependencies);
    }
}
 
Example #27
Source File: XSDSimpleTypeTraverser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
XSSimpleType traverseLocal(Element elmNode,
        XSDocumentInfo schemaDoc,
        SchemaGrammar grammar) {

    // General Attribute Checking
    Object[] attrValues = fAttrChecker.checkAttributes(elmNode, false, schemaDoc);
    String name = genAnonTypeName(elmNode);
    XSSimpleType type = getSimpleType (name, elmNode, attrValues, schemaDoc, grammar);
    if (type instanceof XSSimpleTypeDecl) {
        ((XSSimpleTypeDecl)type).setAnonymous(true);
    }
    fAttrChecker.returnAttrArray(attrValues, schemaDoc);

    return type;
}
 
Example #28
Source File: XSDeclarationPool.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private boolean ensureSTDeclCapacity(int chunk) {
    if (chunk >= fSTDecl.length) {
        fSTDecl = resize(fSTDecl, fSTDecl.length * 2);
    } else if (fSTDecl[chunk] != null) {
        return false;
    }

    fSTDecl[chunk] = new XSSimpleTypeDecl[CHUNK_SIZE];
    return true;
}
 
Example #29
Source File: XSDeclarationPool.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public final XSSimpleTypeDecl getSimpleTypeDecl(){
    int     chunk       = fSTDeclIndex >> CHUNK_SHIFT;
    int     index       = fSTDeclIndex &  CHUNK_MASK;
    ensureSTDeclCapacity(chunk);
    if (fSTDecl[chunk][index] == null) {
        fSTDecl[chunk][index] = dvFactory.newXSSimpleTypeDecl();
    } else {
        fSTDecl[chunk][index].reset();
    }
    fSTDeclIndex++;
    return fSTDecl[chunk][index];

}
 
Example #30
Source File: AttrNSImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @see org.w3c.dom.TypeInfo#getTypeNamespace()
 */
public String getTypeNamespace() {
    if (type !=null) {
        if (type instanceof XSSimpleTypeDecl){
            return ((XSSimpleTypeDecl)type).getNamespace();
        }
        return DTD_URI;
    }
    return null;
}