Class JDFParser

  • All Implemented Interfaces:
    org.apache.xerces.xni.XMLDocumentHandler, org.apache.xerces.xni.XMLDTDContentModelHandler, org.apache.xerces.xni.XMLDTDHandler

    public class JDFParser
    extends XMLParser
    • Field Summary

      Fields 
      Modifier and Type Field Description
      boolean bKElementOnly
      Deprecated.
      use XMLParse to parse pure XMLDoc instances
      • Fields inherited from class org.apache.xerces.parsers.DOMParser

        fUseEntityResolver2, SYMBOL_TABLE, USE_ENTITY_RESOLVER2, XMLGRAMMAR_POOL
      • Fields inherited from class org.apache.xerces.parsers.AbstractDOMParser

        CORE_DOCUMENT_CLASS_NAME, CREATE_CDATA_NODES_FEATURE, CREATE_ENTITY_REF_NODES, CURRENT_ELEMENT_NODE, DEFAULT_DOCUMENT_CLASS_NAME, DEFER_NODE_EXPANSION, DOCUMENT_CLASS_NAME, fBaseURIStack, fCreateCDATANodes, fCreateEntityRefNodes, fCurrentCDATASection, fCurrentCDATASectionIndex, fCurrentEntityDecl, fCurrentNode, fCurrentNodeIndex, fDeferNodeExpansion, fDeferredDocumentImpl, fDeferredEntityDecl, fDocument, fDocumentClassName, fDocumentImpl, fDocumentIndex, fDocumentType, fDocumentTypeIndex, fDOMFilter, fErrorHandler, fFilterReject, fFirstChunk, fInCDATASection, fIncludeComments, fIncludeIgnorableWhitespace, fInDTD, fInDTDExternalSubset, fInEntityRef, fInternalSubset, fNamespaceAware, fRejectedElementDepth, fRoot, fSkippedElemStack, fStorePSVI, fStringBuffer, INCLUDE_COMMENTS_FEATURE, INCLUDE_IGNORABLE_WHITESPACE, NAMESPACES, PSVI_DOCUMENT_CLASS_NAME
      • Fields inherited from class org.apache.xerces.parsers.AbstractXMLDocumentParser

        fDocumentSource, fDTDContentModelSource, fDTDSource
      • Fields inherited from class org.apache.xerces.parsers.XMLParser

        ENTITY_RESOLVER, ERROR_HANDLER, fConfiguration
      • Fields inherited from interface org.apache.xerces.xni.XMLDTDContentModelHandler

        OCCURS_ONE_OR_MORE, OCCURS_ZERO_OR_MORE, OCCURS_ZERO_OR_ONE, SEPARATOR_CHOICE, SEPARATOR_SEQUENCE
      • Fields inherited from interface org.apache.xerces.xni.XMLDTDHandler

        CONDITIONAL_IGNORE, CONDITIONAL_INCLUDE
    • Constructor Summary

      Constructors 
      Constructor Description
      JDFParser()
      default constructor
      JDFParser​(java.lang.String strDocType)
      Deprecated.
      - use default constructor
      JDFParser​(JDFParser parser)  
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void cleanup()
      (non-Javadoc) reset all internal variables to a reasonable default
      org.w3c.dom.Element createElementNode​(org.apache.xerces.xni.QName element)  
      java.lang.String getDocumentClass()  
      protected XMLDoc getXMLDoc()  
      JDFDoc parseFile​(java.io.File file)  
      JDFDoc parseFile​(java.lang.String strFile)
      parseFile - parse a file specified by strFile
      JDFDoc parseFile​(java.lang.String strFile, java.lang.String schemaLocation)
      Deprecated.
      set the parser members instead
      JDFDoc parseInputSource​(org.xml.sax.InputSource inSource, java.lang.String schemaLocation, java.lang.String documentClassName, org.xml.sax.ErrorHandler errorHandler, boolean bEraseEmpty, boolean bDoNamespaces)
      Deprecated.
      set the parser members instead
      JDFDoc parseStream​(java.io.InputStream inStream)
      parseStream - parse a stream specified by inStream
      JDFDoc parseString​(java.lang.String stringInput)
      parseString - parse a string specified by stringInput
      protected XMLDoc runParser​(org.xml.sax.InputSource inSource, boolean bEraseEmpty)  
      protected void setDocumentProperties​(KElement root, DocumentXMLImpl memberDocument, java.lang.String namespaceURI)  
      void setJDFSchemaLocation​(java.io.File _schemaLocation)  
      void setJDFSchemaLocation​(java.lang.String schemaLocation)  
      void startDocument​(org.apache.xerces.xni.XMLLocator locator, java.lang.String encoding, org.apache.xerces.xni.NamespaceContext namespaceContext, org.apache.xerces.xni.Augmentations augs)  
      • Methods inherited from class org.apache.xerces.parsers.DOMParser

        getEntityResolver, getErrorHandler, getFeature, getProperty, getXMLParserConfiguration, parse, setEntityResolver, setFeature, setProperty
      • Methods inherited from class org.apache.xerces.parsers.AbstractDOMParser

        abort, attributeDecl, characters, comment, createAttrNode, doctypeDecl, dropDocumentReferences, elementDecl, emptyElement, endAttlist, endCDATA, endConditional, endDocument, endDTD, endElement, endExternalSubset, endGeneralEntity, endParameterEntity, externalEntityDecl, getDocument, getDocumentClassName, handleBaseURI, handleBaseURI, ignorableWhitespace, ignoredCharacters, internalEntityDecl, notationDecl, processingInstruction, reset, setCharacterData, setLocale, startAttlist, startCDATA, startConditional, startDTD, startElement, startExternalSubset, startGeneralEntity, startParameterEntity, textDecl, unparsedEntityDecl, xmlDecl
      • Methods inherited from class org.apache.xerces.parsers.AbstractXMLDocumentParser

        any, element, empty, endContentModel, endGroup, getDocumentSource, getDTDContentModelSource, getDTDSource, occurrence, pcdata, separator, setDocumentSource, setDTDContentModelSource, setDTDSource, startContentModel, startGroup
      • Methods inherited from class org.apache.xerces.parsers.XMLParser

        parse
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • bKElementOnly

        @Deprecated
        public boolean bKElementOnly
        Deprecated.
        use XMLParse to parse pure XMLDoc instances
        set bKElementOnly=true if you want the output ojects all to be instatnces of KElement rather than instantiated JDF instances
    • Constructor Detail

      • JDFParser

        public JDFParser()
        default constructor
      • JDFParser

        @Deprecated
        public JDFParser​(java.lang.String strDocType)
        Deprecated.
        - use default constructor
        Parameters:
        strDocType -
      • JDFParser

        public JDFParser​(JDFParser parser)
        Parameters:
        parser -
    • Method Detail

      • cleanup

        public void cleanup()
        (non-Javadoc) reset all internal variables to a reasonable default
        Overrides:
        cleanup in class XMLParser
        See Also:
        AbstractDOMParser.reset()
      • parseFile

        public JDFDoc parseFile​(java.lang.String strFile)
        parseFile - parse a file specified by strFile
        Overrides:
        parseFile in class XMLParser
        Parameters:
        strFile - link to the document to parse, may be either a file path or a url
        Returns:
        JDFDoc or null if File not found
      • parseFile

        public JDFDoc parseFile​(java.io.File file)
        Overrides:
        parseFile in class XMLParser
        Parameters:
        file -
        Returns:
      • parseFile

        @Deprecated
        public JDFDoc parseFile​(java.lang.String strFile,
                                java.lang.String schemaLocation)
        Deprecated.
        set the parser members instead
        parseFile - parse a file specified by strFile
        Parameters:
        strFile - link to the document to parse
        schemaLocation - link to the schema to use, null if no validation required
        Returns:
        JDFDoc or null if File not found default: parseFile(strFile,null)
      • parseString

        public JDFDoc parseString​(java.lang.String stringInput)
        parseString - parse a string specified by stringInput
        Overrides:
        parseString in class XMLParser
        Parameters:
        stringInput - string to parse
        Returns:
        JDFDoc or null if parse failed default: parseString(stringInput)
      • parseStream

        public JDFDoc parseStream​(java.io.InputStream inStream)
        parseStream - parse a stream specified by inStream
        Overrides:
        parseStream in class XMLParser
        Parameters:
        inStream - stream to parse
        Returns:
        JDFDoc or null if parse failed default: parseStream(inStream)
      • parseInputSource

        @Deprecated
        public JDFDoc parseInputSource​(org.xml.sax.InputSource inSource,
                                       java.lang.String schemaLocation,
                                       java.lang.String documentClassName,
                                       org.xml.sax.ErrorHandler errorHandler,
                                       boolean bEraseEmpty,
                                       boolean bDoNamespaces)
        Deprecated.
        set the parser members instead
        This is the sophisticated parse function, where validation, error handlers et al. can be set
        Parameters:
        inSource -
        schemaLocation - schema location, null if no validation required
        documentClassName -
        errorHandler -
        bEraseEmpty - if true empty nodes are erased after parsing
        bDoNamespaces - if false a second parse is done, where namespaces are ignored
        Returns:
        JDFDoc default: parseInputSource(inSource, null, DocumentJDFImpl.class.getName(), null, true, true);
      • getDocumentClass

        public java.lang.String getDocumentClass()
        Overrides:
        getDocumentClass in class XMLParser
        Returns:
        the class name
      • createElementNode

        public org.w3c.dom.Element createElementNode​(org.apache.xerces.xni.QName element)
        Overrides:
        createElementNode in class org.apache.xerces.parsers.AbstractDOMParser
        See Also:
        AbstractDOMParser.createElementNode(org.apache.xerces.xni.QName)
      • setJDFSchemaLocation

        public void setJDFSchemaLocation​(java.io.File _schemaLocation)
        Parameters:
        _schemaLocation - the schema location
      • setJDFSchemaLocation

        public void setJDFSchemaLocation​(java.lang.String schemaLocation)
        Parameters:
        schemaLocation - the schema location
      • startDocument

        public void startDocument​(org.apache.xerces.xni.XMLLocator locator,
                                  java.lang.String encoding,
                                  org.apache.xerces.xni.NamespaceContext namespaceContext,
                                  org.apache.xerces.xni.Augmentations augs)
                           throws org.apache.xerces.xni.XNIException
        Specified by:
        startDocument in interface org.apache.xerces.xni.XMLDocumentHandler
        Overrides:
        startDocument in class XMLParser
        Throws:
        org.apache.xerces.xni.XNIException
        See Also:
        AbstractDOMParser.startDocument(org.apache.xerces.xni.XMLLocator, java.lang.String, org.apache.xerces.xni.NamespaceContext, org.apache.xerces.xni.Augmentations)
      • runParser

        protected final XMLDoc runParser​(org.xml.sax.InputSource inSource,
                                         boolean bEraseEmpty)
        Overrides:
        runParser in class XMLParser
        Returns: