Package org.cip4.jdflib.core
Class JDFParser
- java.lang.Object
-
- org.apache.xerces.parsers.XMLParser
-
- org.apache.xerces.parsers.AbstractXMLDocumentParser
-
- org.apache.xerces.parsers.AbstractDOMParser
-
- org.apache.xerces.parsers.DOMParser
-
- org.cip4.jdflib.core.XMLParser
-
- org.cip4.jdflib.core.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 booleanbKElementOnlyDeprecated.use XMLParse to parse pure XMLDoc instances-
Fields inherited from class org.cip4.jdflib.core.XMLParser
ignoreNSDefault, log, m_eraseEmpty, m_ErrorHandler, m_lastExcept, m_SchemaLocation, m_searchStream
-
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidcleanup()(non-Javadoc) reset all internal variables to a reasonable defaultorg.w3c.dom.ElementcreateElementNode(org.apache.xerces.xni.QName element)java.lang.StringgetDocumentClass()protected XMLDocgetXMLDoc()JDFDocparseFile(java.io.File file)JDFDocparseFile(java.lang.String strFile)parseFile - parse a file specified by strFileJDFDocparseFile(java.lang.String strFile, java.lang.String schemaLocation)Deprecated.set the parser members insteadJDFDocparseInputSource(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 insteadJDFDocparseStream(java.io.InputStream inStream)parseStream - parse a stream specified by inStreamJDFDocparseString(java.lang.String stringInput)parseString - parse a string specified by stringInputprotected XMLDocrunParser(org.xml.sax.InputSource inSource, boolean bEraseEmpty)protected voidsetDocumentProperties(KElement root, DocumentXMLImpl memberDocument, java.lang.String namespaceURI)voidsetJDFSchemaLocation(java.io.File _schemaLocation)voidsetJDFSchemaLocation(java.lang.String schemaLocation)voidstartDocument(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.cip4.jdflib.core.XMLParser
addSchemaLocation, initParser, parse, parseInputSource, setErrorHandler, setInputID, setSchemaLocation, toString
-
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, setDocumentClassName, 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
-
-
-
-
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
-
parseFile
public JDFDoc parseFile(java.lang.String strFile)
parseFile - parse a file specified by strFile
-
parseFile
public JDFDoc parseFile(java.io.File file)
-
parseFile
@Deprecated public JDFDoc parseFile(java.lang.String strFile, java.lang.String schemaLocation)
Deprecated.set the parser members insteadparseFile - parse a file specified by strFile- Parameters:
strFile- link to the document to parseschemaLocation- 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:
parseStringin classXMLParser- 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:
parseStreamin classXMLParser- 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 insteadThis is the sophisticated parse function, where validation, error handlers et al. can be set- Parameters:
inSource-schemaLocation- schema location, null if no validation requireddocumentClassName-errorHandler-bEraseEmpty- if true empty nodes are erased after parsingbDoNamespaces- 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:
getDocumentClassin classXMLParser- Returns:
- the class name
-
createElementNode
public org.w3c.dom.Element createElementNode(org.apache.xerces.xni.QName element)
- Overrides:
createElementNodein classorg.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:
startDocumentin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Overrides:
startDocumentin classXMLParser- 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)
-
setDocumentProperties
protected void setDocumentProperties(KElement root, DocumentXMLImpl memberDocument, java.lang.String namespaceURI)
- Overrides:
setDocumentPropertiesin classXMLParser
-
-