|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tapestry.engine.NullWriter
public class NullWriter
A IMarkupWriter that does absolutely nothing; this
is used during the rewind phase of the request cycle when output
is discarded anyway.
| Constructor Summary | |
|---|---|
NullWriter()
|
|
| Method Summary | |
|---|---|
void |
attribute(String name,
boolean value)
Writes a boolean attribute into the currently open tag. |
void |
attribute(String name,
int value)
Writes an integer attribute into the currently open tag. |
void |
attribute(String name,
String value)
Writes an attribute into the most recently opened tag. |
void |
attributeRaw(String name,
String value)
Similar to IMarkupWriter.attribute(String, String) but no escaping of invalid elements
is done for the value. |
void |
begin(String name)
Closes any existing tag then starts a new element. |
void |
beginEmpty(String name)
Starts an element that will not later be matched with an end()
call. |
boolean |
checkError()
Always returns false. |
void |
close()
Closes this IMarkupWriter. |
void |
closeTag()
Closes the most recently opened element by writing the '>' that ends it. |
void |
comment(String value)
Writes an XML/HTML comment. |
void |
end()
Ends the element most recently started by IMarkupWriter.begin(String). |
void |
end(String name)
Ends the most recently started element with the given name. |
void |
flush()
Forwards flush() to this
IMarkupWriter's PrintWriter. |
String |
getContentType()
Returns the type of content generated by this response writer, as a MIME type. |
IMarkupWriter |
getNestedWriter()
Returns this: since a NullWriter doesn't actually
do anything, one is as good as another!. |
static IMarkupWriter |
getSharedInstance()
|
void |
print(char value)
Prints a single character, or its equivalent entity. |
void |
print(char[] data,
int offset,
int length)
The primary print() method, used by most other
methods. |
void |
print(int value)
Prints an integer. |
void |
print(String value)
Invokes IMarkupWriter.print(char[], int, int) to print the string. |
void |
println()
Closes the open tag (if any), then prints a line seperator to the output stream. |
void |
printRaw(char[] buffer,
int offset,
int length)
Prints a portion of an output buffer to the stream. |
void |
printRaw(String value)
Prints output to the stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NullWriter()
| Method Detail |
|---|
public static IMarkupWriter getSharedInstance()
public void printRaw(char[] buffer,
int offset,
int length)
IMarkupWriterprint().
Does nothing if buffer
is null.
Closes any open tag.
printRaw in interface IMarkupWriterpublic void printRaw(String value)
IMarkupWriterprint().
Does nothing if value
is null.
Closes any open tag.
printRaw in interface IMarkupWriterpublic void println()
IMarkupWriter
println in interface IMarkupWriter
public void print(char[] data,
int offset,
int length)
IMarkupWriterprint() method, used by most other
methods.
Prints the character array, first closing any open tag. Problematic characters ('<', '>' and '&') are converted to appropriate entities.
Does nothing if data is null.
Closes any open tag.
print in interface IMarkupWriterpublic void print(char value)
IMarkupWriterCloses any open tag.
print in interface IMarkupWriterpublic void print(int value)
IMarkupWriterCloses any open tag.
print in interface IMarkupWriterpublic void print(String value)
IMarkupWriterIMarkupWriter.print(char[], int, int) to print the string. Use
IMarkupWriter.printRaw(String) if the character data is known to be safe.
Does nothing if value is null.
Closes any open tag.
print in interface IMarkupWriterIMarkupWriter.print(char[], int, int)public IMarkupWriter getNestedWriter()
this: since a NullWriter doesn't actually
do anything, one is as good as another!.
getNestedWriter in interface IMarkupWriterpublic String getContentType()
IMarkupWriter
getContentType in interface IMarkupWriterpublic void flush()
IMarkupWriterflush() to this
IMarkupWriter's PrintWriter.
flush in interface IMarkupWriterpublic void end()
IMarkupWriterIMarkupWriter.begin(String). The name of the tag is popped off of the
active element stack and used to form an HTML close tag.
end in interface IMarkupWriterpublic void end(String name)
IMarkupWriter
end in interface IMarkupWriterpublic void comment(String value)
IMarkupWriter<!-- and -->, and
provides a blank line after the close of the comment.
Most characters are valid inside a comment, so no check
of the contents is made (much like IMarkupWriter.printRaw(String).
comment in interface IMarkupWriterpublic void closeTag()
IMarkupWriterattribute() methods
may not be used until a new element is opened with IMarkupWriter.begin(String) or
or IMarkupWriter.beginEmpty(String).
closeTag in interface IMarkupWriterpublic void close()
IMarkupWriterIMarkupWriter. Close tags are
written for any active elements. The PrintWriter
is then sent close(). A nested writer will commit
its buffer to its containing writer.
close in interface IMarkupWriterpublic boolean checkError()
checkError in interface IMarkupWriterpublic void beginEmpty(String name)
IMarkupWriterend()
call. This is useful for elements that
do not need closing tags.
beginEmpty in interface IMarkupWriterpublic void begin(String name)
IMarkupWriter
begin in interface IMarkupWriter
public void attribute(String name,
int value)
IMarkupWriter
attribute in interface IMarkupWriter
public void attribute(String name,
String value)
IMarkupWriterIMarkupWriter.begin(String)
and before any other kind of writing (which closes the tag).
The value may be null.
attribute in interface IMarkupWriter
public void attribute(String name,
boolean value)
IMarkupWriter
attribute in interface IMarkupWriterIMarkupWriter.attribute(java.lang.String, boolean)
public void attributeRaw(String name,
String value)
IMarkupWriterIMarkupWriter.attribute(String, String) but no escaping of invalid elements
is done for the value.
attributeRaw in interface IMarkupWriterIMarkupWriter.attributeRaw(java.lang.String, java.lang.String)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||