public class Udom2Sax extends SinglePhase_rt
convert(MessageReceiver,ContentHandler,ResultingStructure,Map)
or
convert(MessageReceiver,ContentHandler,LexicalHandler,ResultingStructure,Map)
.ContentHandler
in name-space mode,
like eu.bandm.tools.util.NamespaceEmbedder
.LexicalHandler
is for comments and PIs.Modifier and Type | Field and Description |
---|---|
static AttributesImpl |
ATTRIBUTES_EMPTY |
protected Set<Definition> |
attributesDone
All those definitions the content of which (under the currently
written node) have already been written out as attributes, and
therefore do not need further processing.
|
protected Location<String> |
cachedLocation |
static Map<Definition,Method> |
def2postProcessMethod
Cache for performance.
|
static Map<Definition,PostProcessor> |
def2postProcessObject
Cache for performance.
|
protected Method |
foundPostprocMethod |
protected PostProcessor |
foundPostprocObject |
protected MemString |
lastCharsWritten |
protected Locator |
locator |
protected MessageReceiver<SimpleMessage<Object>> |
msg
Target of all error messages.
|
protected Stack<String> |
namespacesopen |
protected Stack<String> |
namespacesprefix |
static Set<Definition> |
NO_ATTRIBUTES |
protected static Class[] |
pp_args |
protected ContentHandler |
sax
Target of generated write-out.
|
protected LexicalHandler |
saxlex
Target of generated comments and pis.
|
static String |
STRING_defaultNamespacePrefix |
protected ResultingStructure |
toplevelStructure
Diagnosis only.
|
protected boolean |
trimfirst
Indicates that no non-white-space character data has appeared yet, and
(if trimming) whitespace is NOT written to
ws_buffer . |
protected boolean |
trimming
Whether there is any whitespace trimming, as determined by the
node type declaration.
|
protected List<ResultingChars> |
ws_buffer
Accumulator for whitespace which will be written out iff non-white-space
character data follows.
|
_visitor_debug_stream, partial
affectedClasses, fieldFlags, hasdescend, haspost, haspre, METHODNAME_allFields2codeNumber
Constructor and Description |
---|
Udom2Sax() |
Modifier and Type | Method and Description |
---|---|
void |
action(PermutationGroup pg) |
void |
action(ResultingChars chars) |
void |
action(ResultingStructure res_pre)
If argument is not yet written out as attribute, then (1) apply
postproc, (2) collect all attributes, (3) emit an "open element" sax event,
(4) visit sub-structure, (5) emit a "close element" sax event.
|
ResultingStructure |
applyPostProc(ResultingStructure input) |
protected void |
checknamespace(NamespaceName n,
boolean isAttribute)
Generate an SAX call, iff the namespace uri is not yet mapped
to a prefix, and memoize.
|
void |
convert(MessageReceiver<SimpleMessage<Object>> msg,
ContentHandler sax,
ResultingStructure structure,
Map<String,String> namespaceContext)
Top-level entry point.
|
void |
findPostProc(Definition def) |
protected String |
getCharOnly(ResultContainer c) |
protected int |
marknamespace()
Remember the number of currently mapped name spaces.
|
protected void |
memoChars(MemString chars) |
protected void |
memoLoc(ResultingStructure res) |
protected void |
releasenamespace(int level)
Close all namespaces, as they were at the beginning of the element
|
protected void |
updateCache() |
protected void |
wr_simpleElement(NamespaceName tag,
char[] c,
int o,
int l) |
protected void |
write(MemString mem) |
protected void |
write(ResultingChars c) |
protected void |
writeEmptyElement(NamespaceName tag) |
protected void |
writeout_enum(Enumeration enumT,
ResultingStructure res,
AttributesImpl att) |
protected void |
writeSimpleElement_synthetic(NamespaceName tag,
String val)
write a text which is synthetic, ie.
|
protected void |
writeSimpleElement(NamespaceName tag,
MemString val) |
protected void |
ws_buffer_flush()
Called when writing out any non-whitespace character data,
or when starting an "open" tag.
|
action, action, action, action, action, action, action, action, action, collectFlags, getKey, getLowestGeneratedClass
_visitor_trace, action, action, action, action, action, action, action, action, action, allFields2codeNumber, foreignObject, get_class2reachedSccs, get_class2scc, get_field2sccs, match, match, match, match, match, match, match, match, match, match, match, match, match, nomatch
calculateFlags, collectFlags_action, collectFlags_actionDorewrite, collectFlags_actionPreDescendPost, collectFlags_actionRewritefields, collectMethods
public static final String STRING_defaultNamespacePrefix
public static final Map<Definition,Method> def2postProcessMethod
public static final Map<Definition,PostProcessor> def2postProcessObject
protected static final Class[] pp_args
protected Method foundPostprocMethod
protected PostProcessor foundPostprocObject
public static final AttributesImpl ATTRIBUTES_EMPTY
public static final Set<Definition> NO_ATTRIBUTES
protected MemString lastCharsWritten
protected final Locator locator
protected Set<Definition> attributesDone
protected MessageReceiver<SimpleMessage<Object>> msg
SAXException
s) can happen.protected ContentHandler sax
protected LexicalHandler saxlex
protected ResultingStructure toplevelStructure
protected final List<ResultingChars> ws_buffer
protected boolean trimming
protected boolean trimfirst
ws_buffer
.public void findPostProc(Definition def)
public ResultingStructure applyPostProc(ResultingStructure input)
protected void memoChars(MemString chars)
protected void memoLoc(ResultingStructure res)
protected void updateCache()
public void convert(MessageReceiver<SimpleMessage<Object>> msg, ContentHandler sax, ResultingStructure structure, Map<String,String> namespaceContext)
msg
- target for error messages when trying to write the SAX event.sax
- target for the SAX events.structure
- what to write out.namespaceContext
- map of prefices to uris, output at first,
may be ==null.protected void ws_buffer_flush()
protected void checknamespace(NamespaceName n, boolean isAttribute) throws SAXException
SAXException
protected int marknamespace()
protected void releasenamespace(int level) throws SAXException
SAXException
protected String getCharOnly(ResultContainer c)
public void action(ResultingStructure res_pre)
action
in class SinglePhase_rt
public void action(PermutationGroup pg)
action
in class SinglePhase_rt
protected void write(MemString mem)
protected void write(ResultingChars c)
protected void wr_simpleElement(NamespaceName tag, char[] c, int o, int l)
protected void writeSimpleElement(NamespaceName tag, MemString val)
protected void writeSimpleElement_synthetic(NamespaceName tag, String val)
protected void writeEmptyElement(NamespaceName tag)
protected void writeout_enum(Enumeration enumT, ResultingStructure res, AttributesImpl att) throws SAXException
SAXException
public void action(ResultingChars chars)
action
in class SinglePhase_rt
see also the complete user documentation .