|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.apache.axiom.om.impl.builder.SAXOMBuilder
public class SAXOMBuilder
| Constructor Summary | |
|---|---|
SAXOMBuilder()
Deprecated. Instead of creating an instance of this class directly, create a SAXSource and use
OMXMLBuilderFactory.createOMBuilder(SAXSource, boolean). |
|
SAXOMBuilder(OMFactory factory)
Deprecated. Instead of creating an instance of this class directly, create a SAXSource and use
OMXMLBuilderFactory.createOMBuilder(OMFactory, SAXSource, boolean). |
|
SAXOMBuilder(OMFactory factory,
SAXSource source,
boolean expandEntityReferences)
For internal use only. |
|
| Method Summary | |
|---|---|
void |
attributeDecl(String eName,
String aName,
String type,
String mode,
String value)
|
void |
characterData(char[] ch,
int start,
int length,
int nodeType)
|
void |
characters(char[] ch,
int start,
int length)
|
void |
close()
Close this builder. |
void |
comment(char[] ch,
int start,
int length)
|
protected OMElement |
createNextElement(String localName)
|
void |
discard(OMElement el)
|
void |
elementDecl(String name,
String model)
|
void |
endCDATA()
|
void |
endDocument()
|
void |
endDTD()
|
void |
endElement(String uri,
String localName,
String qName)
|
void |
endEntity(String name)
|
void |
endPrefixMapping(String prefix)
|
void |
externalEntityDecl(String name,
String publicId,
String systemId)
|
short |
getBuilderType()
Returns the type of the builder. |
String |
getCharacterEncoding()
Returns the encoding style of the XML data |
OMDocument |
getDocument()
Get the document being built by this builder. |
OMElement |
getDocumentElement()
Get the document element, i.e. the root element of the document. |
OMElement |
getDocumentElement(boolean discardDocument)
Get the document element, optionally discarding the document. |
Object |
getParser()
Allows to access the underlying parser. |
Object |
getRegisteredContentHandler()
get the registered external content handler |
OMElement |
getRootElement()
Get the root element of the Axiom tree built by this content handler. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
|
void |
internalEntityDecl(String name,
String value)
|
boolean |
isCache()
|
boolean |
isCompleted()
|
int |
next()
Proceed the parser one step and return the event value. |
void |
notationDecl(String name,
String publicId,
String systemId)
|
void |
processingInstruction(String target,
String data)
|
void |
registerExternalContentHandler(Object obj)
Registers an external content handler. |
void |
setCache(boolean b)
|
void |
setDocumentLocator(Locator locator)
|
void |
skippedEntity(String name)
|
void |
startCDATA()
|
void |
startDocument()
|
void |
startDTD(String name,
String publicId,
String systemId)
|
void |
startElement(String namespaceURI,
String localName,
String qName,
Attributes atts)
|
void |
startEntity(String name)
|
void |
startPrefixMapping(String prefix,
String uri)
|
void |
unparsedEntityDecl(String name,
String publicId,
String systemId,
String notationName)
|
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
error, fatalError, resolveEntity, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SAXOMBuilder(OMFactory factory,
SAXSource source,
boolean expandEntityReferences)
factory - source - expandEntityReferences - public SAXOMBuilder(OMFactory factory)
SAXSource and use
OMXMLBuilderFactory.createOMBuilder(OMFactory, SAXSource, boolean).
public SAXOMBuilder()
SAXSource and use
OMXMLBuilderFactory.createOMBuilder(SAXSource, boolean).
| Method Detail |
|---|
public void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlersetDocumentLocator in class DefaultHandler
public void startDocument()
throws SAXException
startDocument in interface ContentHandlerstartDocument in class DefaultHandlerSAXException
public void endDocument()
throws SAXException
endDocument in interface ContentHandlerendDocument in class DefaultHandlerSAXException
public void startDTD(String name,
String publicId,
String systemId)
throws SAXException
startDTD in interface LexicalHandlerSAXException
public void elementDecl(String name,
String model)
throws SAXException
elementDecl in interface DeclHandlerSAXException
public void attributeDecl(String eName,
String aName,
String type,
String mode,
String value)
throws SAXException
attributeDecl in interface DeclHandlerSAXException
public void externalEntityDecl(String name,
String publicId,
String systemId)
throws SAXException
externalEntityDecl in interface DeclHandlerSAXException
public void internalEntityDecl(String name,
String value)
throws SAXException
internalEntityDecl in interface DeclHandlerSAXException
public void notationDecl(String name,
String publicId,
String systemId)
throws SAXException
notationDecl in interface DTDHandlernotationDecl in class DefaultHandlerSAXException
public void unparsedEntityDecl(String name,
String publicId,
String systemId,
String notationName)
throws SAXException
unparsedEntityDecl in interface DTDHandlerunparsedEntityDecl in class DefaultHandlerSAXException
public void endDTD()
throws SAXException
endDTD in interface LexicalHandlerSAXException
protected OMElement createNextElement(String localName)
throws OMException
OMException
public void startPrefixMapping(String prefix,
String uri)
throws SAXException
startPrefixMapping in interface ContentHandlerstartPrefixMapping in class DefaultHandlerSAXException
public void endPrefixMapping(String prefix)
throws SAXException
endPrefixMapping in interface ContentHandlerendPrefixMapping in class DefaultHandlerSAXException
public void startElement(String namespaceURI,
String localName,
String qName,
Attributes atts)
throws SAXException
startElement in interface ContentHandlerstartElement in class DefaultHandlerSAXException
public void endElement(String uri,
String localName,
String qName)
throws SAXException
endElement in interface ContentHandlerendElement in class DefaultHandlerSAXException
public void startCDATA()
throws SAXException
startCDATA in interface LexicalHandlerSAXException
public void endCDATA()
throws SAXException
endCDATA in interface LexicalHandlerSAXException
public void characterData(char[] ch,
int start,
int length,
int nodeType)
throws SAXException
SAXException
public void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlercharacters in class DefaultHandlerSAXException
public void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
ignorableWhitespace in interface ContentHandlerignorableWhitespace in class DefaultHandlerSAXException
public void processingInstruction(String target,
String data)
throws SAXException
processingInstruction in interface ContentHandlerprocessingInstruction in class DefaultHandlerSAXException
public void comment(char[] ch,
int start,
int length)
throws SAXException
comment in interface LexicalHandlerSAXException
public void skippedEntity(String name)
throws SAXException
skippedEntity in interface ContentHandlerskippedEntity in class DefaultHandlerSAXException
public void startEntity(String name)
throws SAXException
startEntity in interface LexicalHandlerSAXException
public void endEntity(String name)
throws SAXException
endEntity in interface LexicalHandlerSAXExceptionpublic OMDocument getDocument()
OMXMLParserWrapper
getDocument in interface OMXMLParserWrapperOMDocument instancepublic OMElement getRootElement()
OMException - if the tree is not complete
public int next()
throws OMException
OMXMLParserWrapper
next in interface OMXMLParserWrapperOMException
public void discard(OMElement el)
throws OMException
discard in interface OMXMLParserWrapperOMException
public void setCache(boolean b)
throws OMException
setCache in interface OMXMLParserWrapperOMExceptionpublic boolean isCache()
isCache in interface OMXMLParserWrapperpublic Object getParser()
OMXMLParserWrapper
getParser in interface OMXMLParserWrapperpublic boolean isCompleted()
isCompleted in interface OMXMLParserWrapperpublic OMElement getDocumentElement()
OMXMLParserWrapperOMDocument.getOMDocumentElement() on the document returned by
OMXMLParserWrapper.getDocument().
Note that this method will never return null (except in the very special case
where the document has been requested before and the document element has been removed
explicitly): if the document being parsed has no document element, then this will result in a
parser error, i.e. an OMException will be thrown.
getDocumentElement in interface OMXMLParserWrapperpublic OMElement getDocumentElement(boolean discardDocument)
OMXMLParserWrapperOMXMLParserWrapper.getDocumentElement(). However, if the discardDocument
parameter is set to true, then the document element is removed from the document
and the document itself is discarded. In contrast to using OMNode.detach() this
will not build the element. The implementation also ensures that the element is not built
when it is added to another OM tree. This makes it possible to add the content of a document
to an existing OM tree while preserving the deferred parsing feature. It is even possible to
create an OM tree where different subtrees are associated with different builder instances.
getDocumentElement in interface OMXMLParserWrapperdiscardDocument - specifies whether the document should be discarded
public short getBuilderType()
OMXMLParserWrapperOMConstants.PUSH_TYPE_BUILDER
or OMConstants.PULL_TYPE_BUILDER.
getBuilderType in interface OMXMLParserWrapperpublic void registerExternalContentHandler(Object obj)
OMXMLParserWrapper
registerExternalContentHandler in interface OMXMLParserWrapperpublic Object getRegisteredContentHandler()
OMXMLParserWrapper
getRegisteredContentHandler in interface OMXMLParserWrapperpublic String getCharacterEncoding()
OMXMLParserWrapper
getCharacterEncoding in interface OMXMLParserWrapperpublic void close()
OMXMLParserWrapper
close in interface OMXMLParserWrapper
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||