|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.rave.web.ui.model.Markup
Utility bean that serves as an accumulating buffer for
well formed markup fragments typically generated by renderers.
The fundamental API is modelled after ResponseWriter
in JavaServer Faces.
Constructor Summary | |
Markup()
|
Method Summary | |
void |
clear()
Clear any accumulated markup stored in this object, making it suitable for reuse. |
protected void |
close()
Close the currently open starting element, if any. |
void |
endElement(java.lang.String name)
Accumulate the end of an element, after closing any open element created by a call to startElement() . |
java.lang.String |
getEncoding()
Return the character encoding assumed to be used when the markup contained in this instance is ultimately rendered. |
java.lang.String |
getMarkup()
Return the markup that has been accumulated in this element, as a String suitable for direct transcription to the response buffer. |
protected void |
hexadecimal(int i)
Append the hexadecimal equivalent of the specified numeric value. |
protected void |
hexadecimals(char ch)
Append the specified character as an escaped two-hex-digit value. |
protected void |
numeric(char ch)
Append a numeric escape for the specified character. |
void |
setEncoding(java.lang.String encoding)
Set the character encoding assumed to be used when the markup contained in this instance is ultimately rendered. |
void |
startElement(java.lang.String name,
javax.faces.component.UIComponent component)
Accumulate the start of a new element, up to and including the element name. |
java.lang.String |
toString()
Return the markup that has been accumulated in this element. |
void |
writeAttribute(java.lang.String name,
java.lang.Object value,
java.lang.String property)
Accumulate an attribute name and corresponding value. |
void |
writeComment(java.lang.Object comment)
Accumulate a comment containing the specified text, after converting that text to a String (if necessary) and performing any escaping appropriate for the markup language being rendered. |
void |
writeRaw(java.lang.Object raw,
java.lang.String property)
Accumulate an object, after converting it to a String (if necessary) WITHOUT performing escaping appropriate for the markup language being rendered. |
void |
writeText(java.lang.Object text,
java.lang.String property)
Accumulate an object, after converting it to a String (if necessary) and after performing any escaping appropriate for the markup language being rendered. |
void |
writeURIAttribute(java.lang.String name,
java.lang.Object value,
java.lang.String property)
Accumulate an attribute name and corresponding URI value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Markup()
Method Detail |
public java.lang.String getEncoding()
Return the character encoding assumed to be used when the markup contained in this instance is ultimately rendered.
public void setEncoding(java.lang.String encoding)
Set the character encoding assumed to be used when the markup contained in this instance is ultimately rendered.
encoding
- The new character encodingpublic java.lang.String getMarkup()
Return the markup that has been accumulated in this element, as a String suitable for direct transcription to the response buffer.
public void clear()
Clear any accumulated markup stored in this object, making it suitable for reuse.
public java.lang.String toString()
Return the markup that has been accumulated in this element.
This is an alias for the getMarkup()
method.
public void startElement(java.lang.String name, javax.faces.component.UIComponent component)
Accumulate the start of a new element, up to and including
the element name. Once this method has been called, clients
can call writeAttribute()
or
writeURIAttriute()
to add attributes and their
corresponding values. The starting element will be closed
on any subsequent call to startElement()
,
writeComment()
, writeText()
,
writeRaw()
, endElement()
, or
getMarkup()
.
name
- Name of the element to be startedcomponent
- The UIComponent
(if any)
to which this element corresponds
java.lang.NullPointerException
- if name
is null
public void endElement(java.lang.String name)
Accumulate the end of an element, after closing any open element
created by a call to startElement()
. Elements must be
closed in the inverse order from which they were opened; it is an
error to do otherwise.
name
- Name of the element to be ended
java.lang.NullPointerException
- if name
is null
public void writeAttribute(java.lang.String name, java.lang.Object value, java.lang.String property)
Accumulate an attribute name and corresponding value. This
method may only be called after a call to startElement()
and before the opened element has been closed.
name
- Attribute name to be addedvalue
- Attribute value to be addedproperty
- Name of the component property or attribute (if any)
of the UIComponent
associated with the containing
element, to which the generated attribute corresponds
java.lang.IllegalStateException
- if this method is called
when there is no currently open element
java.lang.NullPointerException
- if name
or value
is null
public void writeURIAttribute(java.lang.String name, java.lang.Object value, java.lang.String property)
Accumulate an attribute name and corresponding URI value. This
method may only be called after a call to startElement()
and before the opened element has been closed.
name
- Attribute name to be addedvalue
- Attribute value to be addedproperty
- Name of the component property or attribute (if any)
of the UIComponent
associated with the containing
element, to which the generated attribute corresponds
java.lang.IllegalStateException
- if this method is called
when there is no currently open element
java.lang.NullPointerException
- if name
or value
is null
public void writeComment(java.lang.Object comment)
Accumulate a comment containing the specified text, after converting that text to a String (if necessary) and performing any escaping appropriate for the markup language being rendered.
If there is an open element that has been created by a call to
startElement()
, that element will be closed first.
comment
- Text content of the comment
java.lang.NullPointerException
- if comment
is null
public void writeRaw(java.lang.Object raw, java.lang.String property)
Accumulate an object, after converting it to a String (if necessary) WITHOUT performing escaping appropriate for the markup language being rendered.
If there is an open element that has been created by a call to
startElement()
, that element will be closed first.
raw
- Raw content to be writtenproperty
- Name of the component property or attribute (if any)
of the UIComponent
associated with the containing
element, to which the generated content corresponds
java.lang.NullPointerException
- if text
is null
public void writeText(java.lang.Object text, java.lang.String property)
Accumulate an object, after converting it to a String (if necessary) and after performing any escaping appropriate for the markup language being rendered.
If there is an open element that has been created by a call to
startElement()
, that element will be closed first.
text
- Text to be writtenproperty
- Name of the component property or attribute (if any)
of the UIComponent
associated with the containing
element, to which the generated attribute corresponds
java.lang.NullPointerException
- if text
is null
protected void close()
Close the currently open starting element, if any.
protected void hexadecimal(int i)
Append the hexadecimal equivalent of the specified numeric value.
protected void hexadecimals(char ch)
Append the specified character as an escaped two-hex-digit value.
ch
- Character to be escapedprotected void numeric(char ch)
Append a numeric escape for the specified character.
ch
- Character to be escaped
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |