Package org.apache.xerces.xni.grammars

Examples of org.apache.xerces.xni.grammars.XMLGrammarDescription


     * @param desc The description of the grammar to be compared with
     * @return     True if they are equal, else false
     */
    public boolean equals(Object descObj) {
        if(!(descObj instanceof XMLGrammarDescription)) return false;
        XMLGrammarDescription desc = (XMLGrammarDescription)descObj;
        if (!getGrammarType().equals(desc.getGrammarType())) {
            return false;
        }
        if (fTargetNamespace != null && fTargetNamespace.equals(((XSDDescription)desc).getTargetNamespace())) {
            return true;
        }
View Full Code Here


        return ((DocumentImpl)builder.getDocument()).getNode(nodeNr);
    }
   
    private void writeGrammar(Grammar grammar,  MemTreeBuilder builder){
       
            final XMLGrammarDescription xgd = grammar.getGrammarDescription();
           
            final AttributesImpl attribs = new AttributesImpl();
            attribs.addAttribute("", "type", "type", "CDATA", xgd.getGrammarType());
           
            builder.startElement("", "grammar", "grammar", attribs);
     
            final String namespace=xgd.getNamespace();
            if(namespace!=null){
                builder.startElement("", "Namespace", "Namespace", null);
                builder.characters(namespace);
                builder.endElement();
            }
           
            final String publicId=xgd.getPublicId();
            if(publicId!=null){
                builder.startElement("", "PublicId", "PublicId", null);
                builder.characters(publicId);
                builder.endElement();
            }
            final String baseSystemId=xgd.getBaseSystemId();
            if(baseSystemId!=null){
                builder.startElement("", "BaseSystemId", "BaseSystemId", null);
                builder.characters(baseSystemId);
                builder.endElement();
            }

            final String literalSystemId=xgd.getLiteralSystemId();
            if(literalSystemId!=null){
                builder.startElement("", "LiteralSystemId", "LiteralSystemId", null);
                builder.characters(literalSystemId);
                builder.endElement();
            }
           
            final String expandedSystemId=xgd.getExpandedSystemId();
            if(expandedSystemId!=null){
                builder.startElement("", "ExpandedSystemId", "ExpandedSystemId", null);
                builder.characters(expandedSystemId);
                builder.endElement();
            }
View Full Code Here

     */
    public void putGrammar(Grammar grammar) {
        if (!fPoolIsLocked) {
            synchronized (fGrammars) {
                clean();
                XMLGrammarDescription desc = grammar.getGrammarDescription();
                int hash = hashCode(desc);
                int index = (hash & 0x7FFFFFFF) % fGrammars.length;
                for (Entry entry = fGrammars[index]; entry != null; entry = entry.next) {
                    if (entry.hash == hash && equals(entry.desc, desc)) {
                        if (entry.grammar.get() != grammar) {
View Full Code Here

    } // resolveEntity(String,String,String):XMLInputSource
   
    /** Determines the type of resource being resolved **/
    private String getType(XMLResourceIdentifier resourceIdentifier) {
        if (resourceIdentifier instanceof XMLGrammarDescription) {
            XMLGrammarDescription desc = (XMLGrammarDescription) resourceIdentifier;
            if (XMLGrammarDescription.XML_SCHEMA.equals(desc.getGrammarType())) {
                return XSD_TYPE;
            }
        }
        return XML_TYPE;
    } // getType(XMLResourceIdentifier):String
View Full Code Here

     * @param grammar The Grammar.
     */
    public void putGrammar(Grammar grammar) {
        if(!fPoolIsLocked) {
            synchronized (fGrammars) {
                XMLGrammarDescription desc = grammar.getGrammarDescription();
                int hash = hashCode(desc);
                int index = (hash & 0x7FFFFFFF) % fGrammars.length;
                for (Entry entry = fGrammars[index]; entry != null; entry = entry.next) {
                    if (entry.hash == hash && equals(entry.desc, desc)) {
                        entry.grammar = grammar;
View Full Code Here

    } // resolveEntity(String,String,String):XMLInputSource
   
    /** Determines the type of resource being resolved **/
    private String getType(XMLResourceIdentifier resourceIdentifier) {
        if (resourceIdentifier instanceof XMLGrammarDescription) {
            XMLGrammarDescription desc = (XMLGrammarDescription) resourceIdentifier;
            if (XMLGrammarDescription.XML_SCHEMA.equals(desc.getGrammarType())) {
                return XSD_TYPE;
            }
        }
        return XML_TYPE;
    } // getType(XMLResourceIdentifier):String
View Full Code Here

     * @param grammar The Grammar.
     */
    public void putGrammar(Grammar grammar) {
        if(!fPoolIsLocked) {
            synchronized (fGrammars) {
                XMLGrammarDescription desc = grammar.getGrammarDescription();
                int hash = hashCode(desc);
                int index = (hash & 0x7FFFFFFF) % fGrammars.length;
                for (Entry entry = fGrammars[index]; entry != null; entry = entry.next) {
                    if (entry.hash == hash && equals(entry.desc, desc)) {
                        entry.grammar = grammar;
View Full Code Here

     */
    public void putGrammar(Grammar grammar) {
        if (!fPoolIsLocked) {
            synchronized (fGrammars) {
                clean();
                XMLGrammarDescription desc = grammar.getGrammarDescription();
                int hash = hashCode(desc);
                int index = (hash & 0x7FFFFFFF) % fGrammars.length;
                for (Entry entry = fGrammars[index]; entry != null; entry = entry.next) {
                    if (entry.hash == hash && equals(entry.desc, desc)) {
                        if (entry.grammar.get() != grammar) {
View Full Code Here

     *
     * @param grammar The Grammar.
     */
    public void putGrammar(Grammar grammar) {
        synchronized (fGrammars) {
            XMLGrammarDescription desc = grammar.getGrammarDescription();
            int hash = hashCode(desc);
            int index = (hash & 0x7FFFFFFF) % fGrammars.length;
            for (Entry entry = fGrammars[index]; entry != null; entry = entry.next) {
                if (entry.hash == hash && equals(entry.desc, desc)) {
                    entry.grammar = grammar;
View Full Code Here

     */
    public void putGrammar(Grammar grammar) {
        if (!fPoolIsLocked) {
            synchronized (fGrammars) {
                clean();
                XMLGrammarDescription desc = grammar.getGrammarDescription();
                int hash = hashCode(desc);
                int index = (hash & 0x7FFFFFFF) % fGrammars.length;
                for (Entry entry = fGrammars[index]; entry != null; entry = entry.next) {
                    if (entry.hash == hash && equals(entry.desc, desc)) {
                        if (entry.grammar.get() != grammar) {
View Full Code Here

TOP

Related Classes of org.apache.xerces.xni.grammars.XMLGrammarDescription

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.