org.loom.tags
Class AbstractWriterWrapper<T extends java.io.Writer>

java.lang.Object
  extended by org.loom.tags.AbstractWriterWrapper<T>
All Implemented Interfaces:
WriterWrapper<T>
Direct Known Subclasses:
JspWriterWrapper, PrintWriterWrapper, StringWriterWrapper

public abstract class AbstractWriterWrapper<T extends java.io.Writer>
extends java.lang.Object
implements WriterWrapper<T>

Abstract writer implementation

Author:
icoloma

Field Summary
protected  T writer
           
 
Constructor Summary
AbstractWriterWrapper(T writer)
           
 
Method Summary
 WriterWrapper<T> endJavascript()
          Write a javascript end tag
 void flush()
          Flush the written contents
 T getWriter()
           
 WriterWrapper<T> print(java.lang.Object o)
          Print ant Object, invoking its toString() method
 WriterWrapper<T> printAttribute(java.lang.String name, java.lang.Object value)
          Prints a tag attribute and value, if not null
 WriterWrapper<T> printHiddenField(java.lang.String name, java.lang.Object value)
          Prints a hidden form field if its value is not null
 WriterWrapper<T> startJavascript()
          Write a javascript start tag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.loom.tags.WriterWrapper
print
 

Field Detail

writer

protected T extends java.io.Writer writer
Constructor Detail

AbstractWriterWrapper

public AbstractWriterWrapper(T writer)
Method Detail

printAttribute

public WriterWrapper<T> printAttribute(java.lang.String name,
                                       java.lang.Object value)
                                                       throws java.io.IOException
Description copied from interface: WriterWrapper
Prints a tag attribute and value, if not null

Specified by:
printAttribute in interface WriterWrapper<T extends java.io.Writer>
Parameters:
name - name of the attribute
value - value of the attribute. If null, nothing will be written
Returns:
this same instance
Throws:
java.io.IOException

getWriter

public T getWriter()
Specified by:
getWriter in interface WriterWrapper<T extends java.io.Writer>
Returns:
the true writer instance

print

public WriterWrapper<T> print(java.lang.Object o)
                                              throws java.io.IOException
Description copied from interface: WriterWrapper
Print ant Object, invoking its toString() method

Specified by:
print in interface WriterWrapper<T extends java.io.Writer>
Returns:
this same instance
Throws:
java.io.IOException

printHiddenField

public WriterWrapper<T> printHiddenField(java.lang.String name,
                                         java.lang.Object value)
                                                         throws java.io.IOException
Description copied from interface: WriterWrapper
Prints a hidden form field if its value is not null

Specified by:
printHiddenField in interface WriterWrapper<T extends java.io.Writer>
Parameters:
name - name of the field
value - value of the field. If null, nothing will be written
Throws:
java.io.IOException

startJavascript

public WriterWrapper<T> startJavascript()
                                                        throws java.io.IOException
Description copied from interface: WriterWrapper
Write a javascript start tag

Specified by:
startJavascript in interface WriterWrapper<T extends java.io.Writer>
Throws:
java.io.IOException

endJavascript

public WriterWrapper<T> endJavascript()
                                                      throws java.io.IOException
Description copied from interface: WriterWrapper
Write a javascript end tag

Specified by:
endJavascript in interface WriterWrapper<T extends java.io.Writer>
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Description copied from interface: WriterWrapper
Flush the written contents

Specified by:
flush in interface WriterWrapper<T extends java.io.Writer>
Throws:
java.io.IOException


The Loom Framework 1.6-SNAPSHOT.
Licensed under the Apache License, Version 2.0 by Extrema Sistemas de Informacion S.L.