|
Qizx fe-4.4p2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.qizx.xdm.AttributeList
com.qizx.xdm.XMLPushStreamBase
com.qizx.api.util.PushStreamToSAX
public class PushStreamToSAX
An implementation of XMLPushStream that converts to SAX2 events.
This class can be used to export or convert a XML tree from Qizx to any handler accepting SAX2 events.
Field Summary |
---|
Fields inherited from interface com.qizx.api.XMLPushStream |
---|
NSCOPY_NOPRESERVE_INHERIT, NSCOPY_NOPRESERVE_NOINHERIT, NSCOPY_PRESERVE_INHERIT, NSCOPY_PRESERVE_NOINHERIT |
Constructor Summary | |
---|---|
PushStreamToSAX()
Creates an adapter without handlers. |
|
PushStreamToSAX(DefaultHandler handler)
Creates an SAX adapter directly bound to a SAX DefaultHandler. |
Method Summary | |
---|---|
ContentHandler |
getContentHandler()
Returns the current SAX content handler. |
ErrorHandler |
getErrorHandler()
Returns the current SAX error handler. |
LexicalHandler |
getLexicalHandler()
Returns the current SAX lexical handler. |
boolean |
getNsPrefixes()
Gets the "NS prefixes" option: controls namespace prefix output. |
void |
putComment(String value)
Puts a Comment event. |
void |
putDocumentEnd()
Puts a Document End event. |
boolean |
putDocumentStart()
Puts a Document Start event. |
void |
putElementEnd(QName name)
Puts an Element End event. |
boolean |
putNamespace(String prefix,
String namespaceURI)
Puts a Namespace declaration event for the current element. |
void |
putProcessingInstruction(String target,
String value)
Puts a Processing-instruction event. |
void |
putText(String value)
Puts a Text Fragment event. |
void |
setContentHandler(ContentHandler handler)
Sets the current SAX content handler. |
void |
setErrorHandler(ErrorHandler handler)
Sets the current SAX error handler. |
void |
setLexicalHandler(LexicalHandler handler)
Sets the current SAX lexical output handler. |
void |
setNsPrefixes(boolean nsPrefixes)
Sets the "NS prefixes" option: controls namespace prefix output. |
Methods inherited from class com.qizx.xdm.XMLPushStreamBase |
---|
abort, defineContextMappings, flush, getNSPrefix, getNSURI, isAtRoot, maxVolumeReached, noSpace, putAtom, putAtomText, putAttribute, putChars, putDTD, putElementStart, putLongAtom, putNamespaces, putNodeCopy, putNodeCopy, putNodeText, reset, setCheckNS, setMaxVolume, setTrace |
Methods inherited from class com.qizx.xdm.AttributeList |
---|
addAttribute, getAttributeCount, getIndex, getIndex, getIndex, getLength, getLocalName, getNamespaceContext, getNamespaceCount, getNamespacePrefix, getNamespaceURI, getQName, getType, getType, getType, getURI, getValue, getValue, getValue |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PushStreamToSAX()
The SAX handlers must then be defined through the set*Handler methods.
public PushStreamToSAX(DefaultHandler handler)
handler
- used as content handler and error handler.Method Detail |
---|
public boolean getNsPrefixes()
public void setNsPrefixes(boolean nsPrefixes)
nsPrefixes
- if false, do not output prefixes in SAXpublic ContentHandler getContentHandler()
public void setContentHandler(ContentHandler handler)
handler
- SAX content handler used as output (can be null)public LexicalHandler getLexicalHandler()
public void setLexicalHandler(LexicalHandler handler)
handler
- SAX lexical handler used as output (can be null)public ErrorHandler getErrorHandler()
public void setErrorHandler(ErrorHandler handler)
handler
- SAX error handler used (can be null)public boolean putDocumentStart() throws DataModelException
XMLPushStream
putDocumentStart
in interface XMLPushStream
putDocumentStart
in class com.qizx.xdm.XMLPushStreamBase
DataModelException
- reasonspublic void putDocumentEnd() throws DataModelException
XMLPushStream
putDocumentEnd
in interface XMLPushStream
putDocumentEnd
in class com.qizx.xdm.XMLPushStreamBase
DataModelException
- reasonspublic void putElementEnd(QName name) throws DataModelException
XMLPushStream
putElementEnd
in interface XMLPushStream
putElementEnd
in class com.qizx.xdm.XMLPushStreamBase
name
- qualified name of the element
DataModelException
- reasonspublic boolean putNamespace(String prefix, String namespaceURI) throws DataModelException
XMLPushStream
Must follow putElementStart and precede the contents of the element. The order is irrelevant. Duplicate namespace declarations are normally an error.
A Namespace declaration associates a prefix with a namespace-URI; it is
equivalent to the xmlns:
pseudo-attributes of XML markup.
The empty prefix may be used for the default element namespace.
Note that such declarations are not mandatory: prefixes can be synthesized automatically by a XMLSerializer if missing.
putNamespace
in interface XMLPushStream
putNamespace
in class com.qizx.xdm.XMLPushStreamBase
prefix
- prefix of the namespace, can be the empty string, but not
nullnamespaceURI
- URI of the namespace: may not be null. The empty
string means that the namespace-URI associated with the current
prefix is erased (a XML 1.1 feature)
DataModelException
- reasonspublic void putText(String value) throws DataModelException
XMLPushStream
A text fragment should appear inside an element. Consecutive text events are coalesced into one. An empty text fragment is discarded.
value
- a fragment of text
DataModelException
- reasonspublic void putProcessingInstruction(String target, String value) throws DataModelException
XMLPushStream
putProcessingInstruction
in interface XMLPushStream
putProcessingInstruction
in class com.qizx.xdm.XMLPushStreamBase
target
- target (name) of the PIvalue
- contents of the PI
DataModelException
- reasonspublic void putComment(String value) throws DataModelException
XMLPushStream
putComment
in interface XMLPushStream
putComment
in class com.qizx.xdm.XMLPushStreamBase
value
- contents of a comment.
DataModelException
- reasons
|
© 2010 Axyana Software | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |