|
Java EE 5 SDK 深圳电信培训中心.徐海蛟老师. |
||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造器 | 方法 | 详细信息: 字段 | 构造器 | 方法 |
javax.faces.context Class ResponseWriter
java.lang.Object java.io.Writer javax.faces.context.ResponseWriter
- 所有已实现的接口:
- Closeable, Flushable, Appendable
- 直接已知子类:
- ResponseWriterWrapper
public abstract class ResponseWriter
- extends Writer
ResponseWriter is an abstract class describing an
adapter to an underlying output mechanism for character-based output.
In addition to the low-level write()
methods inherited from
java.io.Writer
, this class provides utility methods
that are useful in producing elements and attributes for markup languages
like HTML and XML.
字段摘要 |
---|
Fields inherited from class java.io.Writer |
---|
lock |
构造器摘要 | |
---|---|
ResponseWriter()
|
方法摘要 | |
---|---|
abstract ResponseWriter |
cloneWithWriter(Writer writer)
Create and return a new instance of this ResponseWriter ,
using the specified Writer as the output destination. |
abstract void |
endDocument()
Write whatever text should end a response. |
abstract void |
endElement(String name)
Write the end of an element, after closing any open element created by a call to startElement() . |
abstract void |
flush()
Flush any ouput buffered by the output method to the underlying Writer or OutputStream. |
abstract String |
getCharacterEncoding()
Return the character encoding (such as "ISO-8859-1") for this ResponseWriter . |
abstract String |
getContentType()
Return the content type (such as "text/html") for this ResponseWriter . |
abstract void |
startDocument()
Write whatever text should begin a response. |
abstract void |
startElement(String name,
UIComponent component)
Write the start of an element, up to and including the element name. |
abstract void |
writeAttribute(String name,
Object value,
String property)
Write an attribute name and corresponding value, after converting that text to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered. |
abstract void |
writeComment(Object comment)
Write a comment containing the specified text, after converting that text to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered. |
abstract void |
writeText(char[] text,
int off,
int len)
Write text from a character array, after any performing any escaping appropriate for the markup language being rendered. |
abstract void |
writeText(Object text,
String property)
Write an object, after converting it to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered. |
void |
writeText(Object text,
UIComponent component,
String property)
Write an object, after converting it to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered. |
abstract void |
writeURIAttribute(String name,
Object value,
String property)
Write a URI attribute name and corresponding value, after converting that text to a String (if necessary), and after performing any encoding appropriate to the markup language being rendered. |
类方法继承 java.io.Writer |
---|
append, append, append, close, write, write, write, write, write |
类方法继承 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
构造器详细信息 |
---|
ResponseWriter
public ResponseWriter()
方法详细信息 |
---|
getContentType
public abstract String getContentType()
Return the content type (such as "text/html") for this
ResponseWriter
. Note: this must not include the "charset=" suffix.
getCharacterEncoding
public abstract String getCharacterEncoding()
Return the character encoding (such as "ISO-8859-1") for this
ResponseWriter
. Please see the IANA for a list of character encodings.
flush
public abstract void flush() throws IOException
Flush any ouput buffered by the output method to the underlying Writer or OutputStream. This method will not flush the underlying Writer or OutputStream; it simply clears any values buffered by this
ResponseWriter
.- 抛出异常:
IOException
startDocument
public abstract void startDocument() throws IOException
Write whatever text should begin a response.
- 抛出异常:
IOException
- if an input/output error occurs
endDocument
public abstract void endDocument() throws IOException
Write whatever text should end a response. If there is an open element that has been created by a call to
startElement()
, that element will be closed first.- 抛出异常:
IOException
- if an input/output error occurs
startElement
public abstract void startElement(String name, UIComponent component) throws IOException
Write the start of an element, up to and including the element name. Once this method has been called, clients can call the
writeAttribute()
orwriteURIAttribute()
methods to add attributes and corresponding values. The starting element will be closed (that is, the trailing '>' character added) on any subsequent call tostartElement()
,writeComment()
,writeText()
,endElement()
,endDocument()
,close()
,flush()
, orwrite()
.- 参数:
name
- Name of the element to be startedcomponent
- TheUIComponent
(if any) to which this element corresponds- 抛出异常:
IOException
- if an input/output error occursNullPointerException
- ifname
isnull
endElement
public abstract void endElement(String name) throws IOException
Write 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- 抛出异常:
IOException
- if an input/output error occursNullPointerException
- ifname
isnull
writeAttribute
public abstract void writeAttribute(String name, Object value, String property) throws IOException
Write an attribute name and corresponding value, after converting that text to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered. 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 property or attribute (if any) of theUIComponent
associated with the containing element, to which this generated attribute corresponds- 抛出异常:
IllegalStateException
- if this method is called when there is no currently open elementIOException
- if an input/output error occursNullPointerException
- ifname
isnull
writeURIAttribute
public abstract void writeURIAttribute(String name, Object value, String property) throws IOException
Write a URI attribute name and corresponding value, after converting that text to a String (if necessary), and after performing any encoding appropriate to the markup language being rendered. 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 property or attribute (if any) of theUIComponent
associated with the containing element, to which this generated attribute corresponds- 抛出异常:
IllegalStateException
- if this method is called when there is no currently open elementIOException
- if an input/output error occursNullPointerException
- ifname
isnull
writeComment
public abstract void writeComment(Object comment) throws IOException
Write a comment containing the specified text, after converting that text 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.- 参数:
comment
- Text content of the comment- 抛出异常:
IOException
- if an input/output error occursNullPointerException
- ifcomment
isnull
writeText
public abstract void writeText(Object text, String property) throws IOException
Write 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 property or attribute (if any) of theUIComponent
associated with the containing element, to which this generated text corresponds- 抛出异常:
IOException
- if an input/output error occursNullPointerException
- iftext
isnull
writeText
public void writeText(Object text, UIComponent component, String property) throws IOException
Write an object, after converting it to a String (if necessary), and after performing any escaping appropriate for the markup language being rendered. This method is equivalent to
writeText(java.lang.Object,java.lang.String)
but adds acomponent
property to allow customResponseWriter
implementations to associate a component with an arbitrary portion of text.The default implementation simply ignores the
component
argument and calls through towriteText(java.lang.Object,java.lang.String)
- 参数:
text
- Text to be writtencomponent
- TheUIComponent
(if any) to which this element correspondsproperty
- Name of the property or attribute (if any) of theUIComponent
associated with the containing element, to which this generated text corresponds- 抛出异常:
IOException
- if an input/output error occursNullPointerException
- iftext
isnull
- 从以下版本开始:
- 1.2
writeText
public abstract void writeText(char[] text, int off, int len) throws IOException
Write text from a character array, after any 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 writtenoff
- Starting offset (zero-relative)len
- Number of characters to be written- 抛出异常:
IndexOutOfBoundsException
- if the calculated starting or ending position is outside the bounds of the character arrayIOException
- if an input/output error occursNullPointerException
- iftext
isnull
cloneWithWriter
public abstract ResponseWriter cloneWithWriter(Writer writer)
Create and return a new instance of this
ResponseWriter
, using the specifiedWriter
as the output destination.- 参数:
writer
- TheWriter
that is the output destination
|
Java EE 5 SDK 深圳电信培训中心.徐海蛟老师. |
||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造器 | 方法 | 详细信息: 字段 | 构造器 | 方法 |
提交错误或意见
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.