Java Code Examples for com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription#XML_SCHEMA

The following examples show how to use com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription#XML_SCHEMA . 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: XSDHandler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public Grammar retrieveGrammar(XMLGrammarDescription desc) {
    if (desc.getGrammarType() == XMLGrammarDescription.XML_SCHEMA) {
        final String tns = ((XMLSchemaDescription) desc).getTargetNamespace();
        if (fGrammarBucket != null) {
            Grammar grammar = fGrammarBucket.getGrammar(tns);
            if (grammar != null) {
                return grammar;
            }
        }
        if (SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(tns)) {
            return SchemaGrammar.Schema4Annotations.INSTANCE;
        }
    }
    return null;
}
 
Example 2
Source File: XSDHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public Grammar[] retrieveInitialGrammarSet(String grammarType) {
    if (grammarType == XMLGrammarDescription.XML_SCHEMA) {
        if (fInitialGrammarSet == null) {
            if (fGrammarBucket == null) {
                fInitialGrammarSet = new Grammar [] {SchemaGrammar.Schema4Annotations.INSTANCE};
            }
            else {
                SchemaGrammar [] schemaGrammars = fGrammarBucket.getGrammars();
                /**
                 * If the grammar bucket already contains the schema for schemas
                 * then we already have the definitions for the parts relevant
                 * to annotations.
                 */
                for (int i = 0; i < schemaGrammars.length; ++i) {
                    if (SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(schemaGrammars[i].getTargetNamespace())) {
                        fInitialGrammarSet = schemaGrammars;
                        return fInitialGrammarSet;
                    }
                }
                Grammar [] grammars = new Grammar[schemaGrammars.length + 1];
                System.arraycopy(schemaGrammars, 0, grammars, 0, schemaGrammars.length);
                grammars[grammars.length - 1] = SchemaGrammar.Schema4Annotations.INSTANCE;
                fInitialGrammarSet = grammars;
            }
        }
        return fInitialGrammarSet;
    }
    return new Grammar[0];
}
 
Example 3
Source File: XSDHandler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public Grammar retrieveGrammar(XMLGrammarDescription desc) {
    if (desc.getGrammarType() == XMLGrammarDescription.XML_SCHEMA) {
        final String tns = ((XMLSchemaDescription) desc).getTargetNamespace();
        if (fGrammarBucket != null) {
            Grammar grammar = fGrammarBucket.getGrammar(tns);
            if (grammar != null) {
                return grammar;
            }
        }
        if (SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(tns)) {
            return SchemaGrammar.Schema4Annotations.INSTANCE;
        }
    }
    return null;
}
 
Example 4
Source File: XSDHandler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public Grammar[] retrieveInitialGrammarSet(String grammarType) {
    if (grammarType == XMLGrammarDescription.XML_SCHEMA) {
        if (fInitialGrammarSet == null) {
            if (fGrammarBucket == null) {
                fInitialGrammarSet = new Grammar [] {SchemaGrammar.Schema4Annotations.INSTANCE};
            }
            else {
                SchemaGrammar [] schemaGrammars = fGrammarBucket.getGrammars();
                /**
                 * If the grammar bucket already contains the schema for schemas
                 * then we already have the definitions for the parts relevant
                 * to annotations.
                 */
                for (int i = 0; i < schemaGrammars.length; ++i) {
                    if (SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(schemaGrammars[i].getTargetNamespace())) {
                        fInitialGrammarSet = schemaGrammars;
                        return fInitialGrammarSet;
                    }
                }
                Grammar [] grammars = new Grammar[schemaGrammars.length + 1];
                System.arraycopy(schemaGrammars, 0, grammars, 0, schemaGrammars.length);
                grammars[grammars.length - 1] = SchemaGrammar.Schema4Annotations.INSTANCE;
                fInitialGrammarSet = grammars;
            }
        }
        return fInitialGrammarSet;
    }
    return new Grammar[0];
}
 
Example 5
Source File: XSDHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public Grammar retrieveGrammar(XMLGrammarDescription desc) {
    if (desc.getGrammarType() == XMLGrammarDescription.XML_SCHEMA) {
        final String tns = ((XMLSchemaDescription) desc).getTargetNamespace();
        if (fGrammarBucket != null) {
            Grammar grammar = fGrammarBucket.getGrammar(tns);
            if (grammar != null) {
                return grammar;
            }
        }
        if (SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(tns)) {
            return SchemaGrammar.Schema4Annotations.INSTANCE;
        }
    }
    return null;
}
 
Example 6
Source File: XSDHandler.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public Grammar[] retrieveInitialGrammarSet(String grammarType) {
    if (grammarType == XMLGrammarDescription.XML_SCHEMA) {
        if (fInitialGrammarSet == null) {
            if (fGrammarBucket == null) {
                fInitialGrammarSet = new Grammar [] {SchemaGrammar.Schema4Annotations.INSTANCE};
            }
            else {
                SchemaGrammar [] schemaGrammars = fGrammarBucket.getGrammars();
                /**
                 * If the grammar bucket already contains the schema for schemas
                 * then we already have the definitions for the parts relevant
                 * to annotations.
                 */
                for (int i = 0; i < schemaGrammars.length; ++i) {
                    if (SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(schemaGrammars[i].getTargetNamespace())) {
                        fInitialGrammarSet = schemaGrammars;
                        return fInitialGrammarSet;
                    }
                }
                Grammar [] grammars = new Grammar[schemaGrammars.length + 1];
                System.arraycopy(schemaGrammars, 0, grammars, 0, schemaGrammars.length);
                grammars[grammars.length - 1] = SchemaGrammar.Schema4Annotations.INSTANCE;
                fInitialGrammarSet = grammars;
            }
        }
        return fInitialGrammarSet;
    }
    return new Grammar[0];
}
 
Example 7
Source File: XSDHandler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public Grammar retrieveGrammar(XMLGrammarDescription desc) {
    if (desc.getGrammarType() == XMLGrammarDescription.XML_SCHEMA) {
        final String tns = ((XMLSchemaDescription) desc).getTargetNamespace();
        if (fGrammarBucket != null) {
            Grammar grammar = fGrammarBucket.getGrammar(tns);
            if (grammar != null) {
                return grammar;
            }
        }
        if (SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(tns)) {
            return SchemaGrammar.Schema4Annotations.INSTANCE;
        }
    }
    return null;
}
 
Example 8
Source File: XSDHandler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public Grammar retrieveGrammar(XMLGrammarDescription desc) {
    if (desc.getGrammarType() == XMLGrammarDescription.XML_SCHEMA) {
        final String tns = ((XMLSchemaDescription) desc).getTargetNamespace();
        if (fGrammarBucket != null) {
            Grammar grammar = fGrammarBucket.getGrammar(tns);
            if (grammar != null) {
                return grammar;
            }
        }
        if (SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(tns)) {
            return SchemaGrammar.Schema4Annotations.INSTANCE;
        }
    }
    return null;
}
 
Example 9
Source File: XSDHandler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public Grammar[] retrieveInitialGrammarSet(String grammarType) {
    if (grammarType == XMLGrammarDescription.XML_SCHEMA) {
        if (fInitialGrammarSet == null) {
            if (fGrammarBucket == null) {
                fInitialGrammarSet = new Grammar [] {SchemaGrammar.Schema4Annotations.INSTANCE};
            }
            else {
                SchemaGrammar [] schemaGrammars = fGrammarBucket.getGrammars();
                /**
                 * If the grammar bucket already contains the schema for schemas
                 * then we already have the definitions for the parts relevant
                 * to annotations.
                 */
                for (int i = 0; i < schemaGrammars.length; ++i) {
                    if (SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(schemaGrammars[i].getTargetNamespace())) {
                        fInitialGrammarSet = schemaGrammars;
                        return fInitialGrammarSet;
                    }
                }
                Grammar [] grammars = new Grammar[schemaGrammars.length + 1];
                System.arraycopy(schemaGrammars, 0, grammars, 0, schemaGrammars.length);
                grammars[grammars.length - 1] = SchemaGrammar.Schema4Annotations.INSTANCE;
                fInitialGrammarSet = grammars;
            }
        }
        return fInitialGrammarSet;
    }
    return new Grammar[0];
}
 
Example 10
Source File: XSDHandler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public Grammar[] retrieveInitialGrammarSet(String grammarType) {
    if (grammarType == XMLGrammarDescription.XML_SCHEMA) {
        if (fInitialGrammarSet == null) {
            if (fGrammarBucket == null) {
                fInitialGrammarSet = new Grammar [] {SchemaGrammar.Schema4Annotations.INSTANCE};
            }
            else {
                SchemaGrammar [] schemaGrammars = fGrammarBucket.getGrammars();
                /**
                 * If the grammar bucket already contains the schema for schemas
                 * then we already have the definitions for the parts relevant
                 * to annotations.
                 */
                for (int i = 0; i < schemaGrammars.length; ++i) {
                    if (SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(schemaGrammars[i].getTargetNamespace())) {
                        fInitialGrammarSet = schemaGrammars;
                        return fInitialGrammarSet;
                    }
                }
                Grammar [] grammars = new Grammar[schemaGrammars.length + 1];
                System.arraycopy(schemaGrammars, 0, grammars, 0, schemaGrammars.length);
                grammars[grammars.length - 1] = SchemaGrammar.Schema4Annotations.INSTANCE;
                fInitialGrammarSet = grammars;
            }
        }
        return fInitialGrammarSet;
    }
    return new Grammar[0];
}
 
Example 11
Source File: XSDHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public Grammar retrieveGrammar(XMLGrammarDescription desc) {
    if (desc.getGrammarType() == XMLGrammarDescription.XML_SCHEMA) {
        final String tns = ((XMLSchemaDescription) desc).getTargetNamespace();
        if (fGrammarBucket != null) {
            Grammar grammar = fGrammarBucket.getGrammar(tns);
            if (grammar != null) {
                return grammar;
            }
        }
        if (SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(tns)) {
            return SchemaGrammar.Schema4Annotations.INSTANCE;
        }
    }
    return null;
}
 
Example 12
Source File: XSDHandler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public Grammar retrieveGrammar(XMLGrammarDescription desc) {
    if (desc.getGrammarType() == XMLGrammarDescription.XML_SCHEMA) {
        final String tns = ((XMLSchemaDescription) desc).getTargetNamespace();
        if (fGrammarBucket != null) {
            Grammar grammar = fGrammarBucket.getGrammar(tns);
            if (grammar != null) {
                return grammar;
            }
        }
        if (SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(tns)) {
            return SchemaGrammar.Schema4Annotations.INSTANCE;
        }
    }
    return null;
}
 
Example 13
Source File: XSDHandler.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public Grammar retrieveGrammar(XMLGrammarDescription desc) {
    if (desc.getGrammarType() == XMLGrammarDescription.XML_SCHEMA) {
        final String tns = ((XMLSchemaDescription) desc).getTargetNamespace();
        if (fGrammarBucket != null) {
            Grammar grammar = fGrammarBucket.getGrammar(tns);
            if (grammar != null) {
                return grammar;
            }
        }
        if (SchemaSymbols.URI_SCHEMAFORSCHEMA.equals(tns)) {
            return SchemaGrammar.Schema4Annotations.INSTANCE;
        }
    }
    return null;
}
 
Example 14
Source File: XSDDescription.java    From jdk8u60 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * the type of the grammar (e.g., DTD or XSD);
 *
 * @see com.sun.org.apache.xerces.internal.xni.grammars.Grammar
 */
public String getGrammarType() {
    return XMLGrammarDescription.XML_SCHEMA;
}
 
Example 15
Source File: XSDDescription.java    From openjdk-8 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * the type of the grammar (e.g., DTD or XSD);
 *
 * @see com.sun.org.apache.xerces.internal.xni.grammars.Grammar
 */
public String getGrammarType() {
    return XMLGrammarDescription.XML_SCHEMA;
}
 
Example 16
Source File: XSDDescription.java    From openjdk-jdk9 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * the type of the grammar (e.g., DTD or XSD);
 *
 * @see com.sun.org.apache.xerces.internal.xni.grammars.Grammar
 */
public String getGrammarType() {
    return XMLGrammarDescription.XML_SCHEMA;
}
 
Example 17
Source File: XSDDescription.java    From openjdk-8-source with GNU General Public License v2.0 2 votes vote down vote up
/**
 * the type of the grammar (e.g., DTD or XSD);
 *
 * @see com.sun.org.apache.xerces.internal.xni.grammars.Grammar
 */
public String getGrammarType() {
    return XMLGrammarDescription.XML_SCHEMA;
}
 
Example 18
Source File: XSDDescription.java    From jdk1.8-source-analysis with Apache License 2.0 2 votes vote down vote up
/**
 * the type of the grammar (e.g., DTD or XSD);
 *
 * @see com.sun.org.apache.xerces.internal.xni.grammars.Grammar
 */
public String getGrammarType() {
    return XMLGrammarDescription.XML_SCHEMA;
}
 
Example 19
Source File: XSDDescription.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 2 votes vote down vote up
/**
 * the type of the grammar (e.g., DTD or XSD);
 *
 * @see com.sun.org.apache.xerces.internal.xni.grammars.Grammar
 */
public String getGrammarType() {
    return XMLGrammarDescription.XML_SCHEMA;
}
 
Example 20
Source File: XSDDescription.java    From Bytecoder with Apache License 2.0 2 votes vote down vote up
/**
 * the type of the grammar (e.g., DTD or XSD);
 *
 * @see com.sun.org.apache.xerces.internal.xni.grammars.Grammar
 */
public String getGrammarType() {
    return XMLGrammarDescription.XML_SCHEMA;
}