|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.cocoon.xml.AbstractXMLProducer org.apache.cocoon.components.parser.JaxpParser
public class JaxpParser
An XMLParser that is only dependant on JAXP 1.1 compliant parsers. The configuration can contain the following parameters :
false
) : should the parser
validate parsed documents ?
false
) : do we want
namespaces declarations also as 'xmlns:' attributes ?true
confuses some XSL
processors (e.g. Saxon).
true
) : do we want to reuse
parsers or create a new parser for each parse ?true
, parsers are not
recycled in case of parsing errors : some parsers (e.g. Xerces) don't like
to be reused after failure.
SAXParserFactory
implementation class to be used instead of using the standard JAXP mechanism
(SAXParserFactory.newInstance()
). This allows to choose
unambiguously the JAXP implementation to be used when several of them are
available in the classpath.
DocumentBuilderFactory
implementation to be used (similar to
sax-parser-factory
for DOM).
Field Summary | |
---|---|
protected DocumentBuilder |
docBuilder
Deprecated. The DOM builder. |
protected DocumentBuilderFactory |
docFactory
Deprecated. the Document Builder factory |
protected SAXParserFactory |
factory
Deprecated. the SAX Parser factory |
protected ComponentManager |
manager
Deprecated. the component manager |
protected boolean |
nsPrefixes
Deprecated. do we want namespaces also as attributes ? |
protected XMLReader |
reader
Deprecated. The SAX reader. |
protected Resolver |
resolver
Deprecated. the Entity Resolver |
protected boolean |
reuseParsers
Deprecated. do we want to reuse parsers ? |
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
---|
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer |
Fields inherited from interface org.apache.cocoon.components.parser.Parser |
---|
ROLE |
Constructor Summary | |
---|---|
JaxpParser()
Deprecated. |
Method Summary | |
---|---|
void |
compose(ComponentManager manager)
Deprecated. Get the Entity Resolver from the component manager |
void |
dispose()
Deprecated. Dispose |
void |
error(SAXParseException e)
Deprecated. Receive notification of a recoverable error. |
void |
fatalError(SAXParseException e)
Deprecated. Receive notification of a fatal error. |
Document |
newDocument()
Deprecated. Create a new Document object. |
Document |
newDocument(String name)
Deprecated. Create a new Document object with a specified DOCTYPE. |
Document |
newDocument(String name,
String publicId,
String systemId)
Deprecated. Create a new Document object with a specified DOCTYPE, public ID and system ID. |
void |
parameterize(Parameters params)
Deprecated. Configure |
void |
parse(InputSource in)
Deprecated. |
Document |
parseDocument(InputSource input)
Deprecated. Parses a new Document object from the given InputSource. |
protected void |
setupDocumentBuilder()
Deprecated. Creates a new DocumentBuilder if needed. |
protected void |
setupXMLReader()
Deprecated. Creates a new XMLReader if needed. |
void |
warning(SAXParseException e)
Deprecated. Receive notification of a warning. |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
---|
recycle, setConsumer, setContentHandler, setLexicalHandler |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.cocoon.components.parser.Parser |
---|
setContentHandler, setLexicalHandler |
Methods inherited from interface org.apache.cocoon.xml.XMLProducer |
---|
setConsumer |
Field Detail |
---|
protected SAXParserFactory factory
protected DocumentBuilderFactory docFactory
protected XMLReader reader
setupXMLReader()
and cleared if a parsing error occurs.
protected DocumentBuilder docBuilder
setupDocumentBuilder()
and cleared if a parsing error occurs.
protected ComponentManager manager
protected Resolver resolver
protected boolean nsPrefixes
protected boolean reuseParsers
Constructor Detail |
---|
public JaxpParser()
Method Detail |
---|
public void compose(ComponentManager manager) throws ComponentException
compose
in interface Composable
ComponentException
public void dispose()
dispose
in interface Disposable
public void parameterize(Parameters params) throws ParameterException
parameterize
in interface Parameterizable
ParameterException
public void parse(InputSource in) throws SAXException, IOException
parse
in interface Parser
SAXException
IOException
public Document newDocument()
newDocument
in interface DOMFactory
public Document newDocument(String name)
newDocument
in interface DOMFactory
public Document newDocument(String name, String publicId, String systemId)
newDocument
in interface DOMFactory
public Document parseDocument(InputSource input) throws SAXException, IOException
parseDocument
in interface Parser
SAXException
IOException
protected void setupXMLReader() throws SAXException
XMLReader
if needed.
SAXException
protected void setupDocumentBuilder()
DocumentBuilder
if needed.
public void error(SAXParseException e) throws SAXException
error
in interface ErrorHandler
SAXException
public void fatalError(SAXParseException e) throws SAXException
fatalError
in interface ErrorHandler
SAXException
public void warning(SAXParseException e) throws SAXException
warning
in interface ErrorHandler
SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |