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
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanDeprecated.use XMLParse to parse pure XMLDoc instancesFields inherited from class org.cip4.jdflib.core.XMLParser
ignoreNSDefault, log, m_eraseEmpty, m_ErrorHandler, m_lastExcept, m_SchemaLocation, m_searchStreamFields inherited from class org.apache.xerces.parsers.DOMParser
fUseEntityResolver2, SYMBOL_TABLE, USE_ENTITY_RESOLVER2, XMLGRAMMAR_POOLFields 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_NAMEFields inherited from class org.apache.xerces.parsers.AbstractXMLDocumentParser
fDocumentSource, fDTDContentModelSource, fDTDSourceFields inherited from class org.apache.xerces.parsers.XMLParser
ENTITY_RESOLVER, ERROR_HANDLER, fConfigurationFields inherited from interface org.apache.xerces.xni.XMLDTDContentModelHandler
OCCURS_ONE_OR_MORE, OCCURS_ZERO_OR_MORE, OCCURS_ZERO_OR_ONE, SEPARATOR_CHOICE, SEPARATOR_SEQUENCEFields inherited from interface org.apache.xerces.xni.XMLDTDHandler
CONDITIONAL_IGNORE, CONDITIONAL_INCLUDE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()(non-Javadoc) reset all internal variables to a reasonable defaultcreateElementNode(org.apache.xerces.xni.QName element) protected XMLDocparseFile - parse a file specified by strFileDeprecated.set the parser members insteadparseInputSource(InputSource inSource, String schemaLocation, String documentClassName, ErrorHandler errorHandler, boolean bEraseEmpty, boolean bDoNamespaces) Deprecated.set the parser members insteadparseStream(InputStream inStream) parseStream - parse a stream specified by inStreamparseString(String stringInput) parseString - parse a string specified by stringInputprotected final XMLDocrunParser(InputSource inSource, boolean bEraseEmpty) protected voidsetDocumentProperties(KElement root, DocumentXMLImpl memberDocument, String namespaceURI) voidsetJDFSchemaLocation(File _schemaLocation) voidsetJDFSchemaLocation(String schemaLocation) voidstartDocument(org.apache.xerces.xni.XMLLocator locator, 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, setDocumentClassName, setErrorHandler, setInputID, setSchemaLocation, toStringMethods inherited from class org.apache.xerces.parsers.DOMParser
getEntityResolver, getErrorHandler, getFeature, getProperty, getXMLParserConfiguration, parse, setEntityResolver, setFeature, setPropertyMethods 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, xmlDeclMethods inherited from class org.apache.xerces.parsers.AbstractXMLDocumentParser
any, element, empty, endContentModel, endGroup, getDocumentSource, getDTDContentModelSource, getDTDSource, occurrence, pcdata, separator, setDocumentSource, setDTDContentModelSource, setDTDSource, startContentModel, startGroupMethods inherited from class org.apache.xerces.parsers.XMLParser
parse
-
Field Details
-
bKElementOnly
Deprecated.use XMLParse to parse pure XMLDoc instancesset bKElementOnly=true if you want the output ojects all to be instatnces of KElement rather than instantiated JDF instances
-
-
Constructor Details
-
JDFParser
public JDFParser()default constructor -
JDFParser
Deprecated.- use default constructor- Parameters:
strDocType-
-
JDFParser
- Parameters:
parser-
-
-
Method Details
-
cleanup
public void cleanup()(non-Javadoc) reset all internal variables to a reasonable default -
parseFile
parseFile - parse a file specified by strFile -
parseFile
-
parseFile
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
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
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(InputSource inSource, String schemaLocation, String documentClassName, 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
- Overrides:
getDocumentClassin classXMLParser- Returns:
- the class name
-
createElementNode
- Overrides:
createElementNodein classorg.apache.xerces.parsers.AbstractDOMParser- See Also:
-
AbstractDOMParser.createElementNode(org.apache.xerces.xni.QName)
-
getXMLDoc
-
setJDFSchemaLocation
- Parameters:
_schemaLocation- the schema location
-
setJDFSchemaLocation
- Parameters:
schemaLocation- the schema location
-
startDocument
public void startDocument(org.apache.xerces.xni.XMLLocator locator, 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, String namespaceURI) - Overrides:
setDocumentPropertiesin classXMLParser
-
runParser
-