|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tapestry5.internal.services.MarkupWriterImpl
public class MarkupWriterImpl
| Constructor Summary | |
|---|---|
MarkupWriterImpl()
Creates a new instance of the MarkupWriter with a DefaultMarkupModel. |
|
MarkupWriterImpl(MarkupModel model)
|
|
MarkupWriterImpl(MarkupModel model,
String encoding)
|
|
| Method Summary | |
|---|---|
void |
addListener(MarkupWriterListener listener)
Adds a markup writer listener that will be notified as elements are started and ended. |
Element |
attributeNS(String namespace,
String attributeName,
String attributeValue)
Creates an attribute within the namespace for the current element. |
void |
attributes(Object... namesAndValues)
Adds a series of attributes and values. |
void |
cdata(String content)
Adds parsed character content. |
void |
comment(String text)
Adds an XML comment. |
Element |
defineNamespace(String namespace,
String namespacePrefix)
Defines a namespace for the currently active element. |
Element |
element(String name,
Object... namesAndValues)
Begins a new element as a child of the current element. |
Element |
elementNS(String namespace,
String elementName)
Starts an element within the given namespace. |
Element |
end()
Ends the current element. |
Document |
getDocument()
Returns the Document into which this writer creates elements or other nodes. |
Element |
getElement()
Returns the currently active element. |
void |
removeListener(MarkupWriterListener listener)
Removes a previously added listener. |
void |
toMarkup(PrintWriter writer)
Converts the collected markup into an markup stream (according to rules provided by the Document's MarkupModel). |
String |
toString()
|
void |
write(String text)
Writes the text as a child of the current element. |
void |
writef(String format,
Object... args)
Writes a formatted string. |
void |
writeRaw(String text)
Writes raw text, text with existing markup that should be passed through the client without change. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MarkupWriterImpl()
DefaultMarkupModel.
public MarkupWriterImpl(MarkupModel model)
public MarkupWriterImpl(MarkupModel model,
String encoding)
| Method Detail |
|---|
public void toMarkup(PrintWriter writer)
MarkupWriterDocument's MarkupModel). The markup stream is sent to the writer.
toMarkup in interface MarkupWriterpublic String toString()
toString in class Objectpublic Document getDocument()
MarkupWriter
getDocument in interface MarkupWriterpublic Element getElement()
MarkupWriter
getElement in interface MarkupWriterpublic void cdata(String content)
MarkupWriterMarkupWriter.write(String).
cdata in interface MarkupWritercontent - pre-parsed contentpublic void write(String text)
MarkupWriter
write in interface MarkupWriter
public void writef(String format,
Object... args)
MarkupWriter
writef in interface MarkupWriterpublic void attributes(Object... namesAndValues)
MarkupWriter
attributes in interface MarkupWriter
public Element element(String name,
Object... namesAndValues)
MarkupWriter
element in interface MarkupWritername - the name of the element to createnamesAndValues - an even number of values, alternating names and values
MarkupWriter.attributes(Object[])public void writeRaw(String text)
MarkupWriter
writeRaw in interface MarkupWriterRawpublic Element end()
MarkupWriter
end in interface MarkupWriterpublic void comment(String text)
MarkupWriter
comment in interface MarkupWriter
public Element attributeNS(String namespace,
String attributeName,
String attributeValue)
MarkupWriter
attributeNS in interface MarkupWriternamespace - URI containing the elementattributeName - name of the attribute within the namespaceattributeValue - the value for the attribute
public Element defineNamespace(String namespace,
String namespacePrefix)
MarkupWriter
defineNamespace in interface MarkupWriternamespace - the namespace URInamespacePrefix - the prefix for elements and attributes associated with the namespace (may be the empty
string for the default namespace)
public Element elementNS(String namespace,
String elementName)
MarkupWriterMarkupWriter.end().
elementNS in interface MarkupWriternamespace - URI containing the elementelementName - name of the element within the namespace
public void addListener(MarkupWriterListener listener)
MarkupWriter
addListener in interface MarkupWriterpublic void removeListener(MarkupWriterListener listener)
MarkupWriter
removeListener in interface MarkupWriter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||