|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.joost.stx.Emitter
public class Emitter
Emitter acts as a filter between the Processor and the real SAX output handler. It maintains a stack of in-scope namespaces and sends corresponding events to the real output handler.
Field Summary | |
---|---|
ContentHandler |
contH
|
private boolean |
dtdAllowed
|
private ErrorHandlerImpl |
errorHandler
|
private boolean |
insideCDATA
|
private MutableAttributes |
lastAttrs
|
private NodeBase |
lastInstruction
|
private String |
lastLName
|
private String |
lastQName
|
private String |
lastUri
|
private LexicalHandler |
lexH
|
private String |
nsDefault
|
private Stack |
nsStack
|
private NamespaceSupport |
nsSupport
|
private Stack |
openedElements
Stack for emitted start events, allows well-formedness check |
Emitter |
prev
Previous emitter. |
Fields inherited from interface net.sf.joost.Constants |
---|
DEBUG, DEFAULT_ENCODING, FEAT_NS, FEAT_NSPREFIX, FEATURE_URI_PREFIX, FUNC_NS, JOOST_EXT_NS, PR_ATTRIBUTES, PR_BUFFER, PR_CHILDREN, PR_CONTINUE, PR_ERROR, PR_SELF, PR_SIBLINGS, STX_NS |
Constructor Summary | |
---|---|
protected |
Emitter(Emitter prev,
StxEmitter handler)
Called from pushEmitter(StxEmitter) |
|
Emitter(ErrorHandlerImpl errorHandler)
|
Method Summary | |
---|---|
void |
addAttribute(String uri,
String qName,
String lName,
String value,
NodeBase instruction)
Adds a dynamic created attribute (via stx:attribute ) |
void |
characters(char[] ch,
int start,
int length,
NodeBase instruction)
Emits characters. |
void |
comment(char[] ch,
int start,
int length,
NodeBase instruction)
Creates a comment. |
void |
createDTD(NodeBase instruction,
String name,
String publicId,
String systemId)
|
void |
endCDATA()
|
void |
endDocument(AbstractInstruction instruction)
Closes a document. |
void |
endElement(String uri,
String lName,
String qName,
AbstractInstruction instruction)
Closes an element. |
Writer |
getResultWriter(String href,
String encoding,
String publicId,
String systemId,
int lineNo,
int colNo,
boolean append)
Provides a Writer object that will be used for
stx:result-document instructions. |
boolean |
isEmitterActive(StxEmitter emitter)
|
void |
processingInstruction(String target,
String data,
NodeBase instruction)
Creates a processing instruction. |
private void |
processLastElement()
Process a stored element start tag (from startElement) |
Emitter |
pushEmitter(StxEmitter handler)
Put the current emitter object on a stack and return a new emitter, which uses the given handler. |
void |
setContentHandler(ContentHandler handler)
|
void |
setLexicalHandler(LexicalHandler handler)
|
void |
startCDATA(NodeBase instruction)
Creates a CDATA section. |
void |
startDocument()
|
void |
startElement(String uri,
String lName,
String qName,
Attributes attrs,
Hashtable namespaces,
NodeBase instruction)
Opens a new element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public ContentHandler contH
private LexicalHandler lexH
private ErrorHandlerImpl errorHandler
private NamespaceSupport nsSupport
private Stack nsStack
private String nsDefault
private Stack openedElements
public Emitter prev
private String lastUri
private String lastLName
private String lastQName
private MutableAttributes lastAttrs
private NodeBase lastInstruction
private boolean insideCDATA
private boolean dtdAllowed
Constructor Detail |
---|
public Emitter(ErrorHandlerImpl errorHandler)
protected Emitter(Emitter prev, StxEmitter handler)
pushEmitter(StxEmitter)
Method Detail |
---|
public Emitter pushEmitter(StxEmitter handler)
handler
- the STX handler for the new emitter
public void setContentHandler(ContentHandler handler)
public void setLexicalHandler(LexicalHandler handler)
private void processLastElement() throws SAXException
SAXException
public void addAttribute(String uri, String qName, String lName, String value, NodeBase instruction) throws SAXException
stx:attribute
)
instruction
- the instruction that causes this method invocation
SAXException
public void startDocument() throws SAXException
SAXException
public void endDocument(AbstractInstruction instruction) throws SAXException
instruction
- the instruction that causes this method invocation
SAXException
public void startElement(String uri, String lName, String qName, Attributes attrs, Hashtable namespaces, NodeBase instruction) throws SAXException
instruction
- the instruction that causes this method invocation
SAXException
public void endElement(String uri, String lName, String qName, AbstractInstruction instruction) throws SAXException
instruction
- the instruction that causes this method invocation
SAXException
public void characters(char[] ch, int start, int length, NodeBase instruction) throws SAXException
instruction
- the instruction that causes this method invocation
SAXException
public void processingInstruction(String target, String data, NodeBase instruction) throws SAXException
instruction
- the instruction that causes this method invocation
SAXException
public void comment(char[] ch, int start, int length, NodeBase instruction) throws SAXException
instruction
- the instruction that causes this method invocation
SAXException
public void startCDATA(NodeBase instruction) throws SAXException
instruction
- the instruction that causes this method invocation
SAXException
public void endCDATA() throws SAXException
SAXException
public void createDTD(NodeBase instruction, String name, String publicId, String systemId) throws SAXException
SAXException
public boolean isEmitterActive(StxEmitter emitter)
public Writer getResultWriter(String href, String encoding, String publicId, String systemId, int lineNo, int colNo, boolean append) throws IOException, SAXException, URISyntaxException
Writer
object that will be used for
stx:result-document
instructions.
href
- the filenameencoding
- the requested encodingpublicId
- public ID of the transformation sheetsystemId
- system ID of the transformation sheetlineNo
- line number of the stx:result-document
instructioncolNo
- column number of the stx:result-document
instructionappend
- flag that determines, whether the new XML should be
appended to an existing file
IOException
SAXException
URISyntaxException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |