com.liferay.faces.util.render
Class IdResponseWriter

java.lang.Object
  extended by java.io.Writer
      extended by javax.faces.context.ResponseWriter
          extended by javax.faces.context.ResponseWriterWrapper
              extended by com.liferay.faces.util.render.IdResponseWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable, javax.faces.FacesWrapper<javax.faces.context.ResponseWriter>

public class IdResponseWriter
extends javax.faces.context.ResponseWriterWrapper

This class is a ResponseWriter that ensures the "id" attribute is always written to a particular element. There are two general use cases for this class: 1. Ensure that the id is always rendered for a specific element. 2. Render a different id than the delegating renderer would normally render.

Author:
Neil Griffin

Field Summary
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
IdResponseWriter(javax.faces.context.ResponseWriter responseWriter, String idElement, String idValue)
           
 
Method Summary
 void endElement(String name)
           
 javax.faces.context.ResponseWriter getWrapped()
           
 void startElement(String name, javax.faces.component.UIComponent component)
           
 void writeAttribute(String name, Object value, String property)
           
 
Methods inherited from class javax.faces.context.ResponseWriterWrapper
cloneWithWriter, close, endCDATA, endDocument, flush, getCharacterEncoding, getContentType, startCDATA, startDocument, write, writeComment, writeDoctype, writePreamble, writeText, writeText, writeText, writeURIAttribute
 
Methods inherited from class java.io.Writer
append, append, append, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdResponseWriter

public IdResponseWriter(javax.faces.context.ResponseWriter responseWriter,
                        String idElement,
                        String idValue)
Method Detail

endElement

public void endElement(String name)
                throws IOException
Overrides:
endElement in class javax.faces.context.ResponseWriterWrapper
Throws:
IOException

getWrapped

public javax.faces.context.ResponseWriter getWrapped()
Specified by:
getWrapped in interface javax.faces.FacesWrapper<javax.faces.context.ResponseWriter>
Overrides:
getWrapped in class javax.faces.context.ResponseWriterWrapper

startElement

public void startElement(String name,
                         javax.faces.component.UIComponent component)
                  throws IOException
Overrides:
startElement in class javax.faces.context.ResponseWriterWrapper
Throws:
IOException

writeAttribute

public void writeAttribute(String name,
                           Object value,
                           String property)
                    throws IOException
Overrides:
writeAttribute in class javax.faces.context.ResponseWriterWrapper
Throws:
IOException


Copyright © 2019 Liferay, Inc.. All rights reserved.