|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.servlet.tbeans.BaseTransformation
public abstract class BaseTransformation
The base object for all Transformation Beans. "Transformation Bean" is the name given to a Java component which consumes data from either a model or via property sets and transforms the data into a different representation that will be streamed to a client (or other consumer). A very common type of Transformation Bean will be one that consumes data from a webAF model (such as DataSetInterface) and represents the data in HTML (such as a TABLE).
Transformation Beans are intended to be used by servlet developers and JSP (Java ServerPages) writers.
The com.sas.servlet.tbeans package contains generic interfaces and base classes that define different types of beans. The final implementation will be language-specific, with the classes residing in a sub-package such as com.sas.servlet.beans.form.html.
For More Information:
Visit the AppDev Studio Developer's Site to access step-by-step examples, white papers and additional usage information at http://support.sas.com/rnd/appdev/.
Examples for this class may be found on the Examples Site.
JSP custom tags provide an alternative to using the TransformationBeans. Visit the Custom Tag Library Reference for additional information on these custom tags.
Constructor Summary | |
---|---|
BaseTransformation()
Default Constructor |
Method Summary | |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener for this TransformationBean |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener for this TransformationBean |
void |
cleanUpResources()
This method releases all of the necessary resources that were needed by the transformation bean to render itself. |
void |
firePropertyChange(java.beans.PropertyChangeEvent evt)
Fire a property change event |
void |
firePropertyChange(java.lang.String propertyName,
boolean oldValue,
boolean newValue)
Fire a property change event |
void |
firePropertyChange(java.lang.String propertyName,
int oldValue,
int newValue)
Fire a property change event |
void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
Fire a property change event |
java.lang.String |
getCustomAttributes()
Gets the custom attributes |
java.lang.String |
getDescription()
Gets the description that will be used to describe this bean to the user. |
java.lang.String |
getId()
Gets the id. |
com.sas.util.transforms.TransformInterface |
getInputTransform()
Retrieve the input transformer that's used when setObjectData gets called. |
java.util.Locale |
getLocale()
Get the locale |
java.lang.String |
getName()
Deprecated. Use getId method instead |
java.lang.Object |
getObjectData()
Retrieve the Object stored in the Object model. |
java.lang.String |
getObjectDataProperty()
Retrieve the property name of the value that gets set when setObjectData gets called. |
com.sas.util.transforms.TransformInterface |
getOutputTransform()
Retrieve the output transformer that's used when getObjectData gets called. |
javax.servlet.http.HttpServletRequest |
getRequest()
Gets the current request object. |
javax.servlet.http.HttpServletResponse |
getResponse()
Gets the current response object. |
java.lang.String |
getTagEpilog()
Returns a string to be written after to any tag information |
java.lang.String |
getTagProlog()
Returns a string to be written prior to any tag information |
boolean |
hasListeners(java.lang.String propertyName)
Check for listeners on the property. |
boolean |
isCleanUpResourcesOn()
Return whether the request and response will automatically be set to null once a TransformationBean
is rendered. |
boolean |
isVisible()
Returns whether or not the transformation bean should be written |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener for this TransformationBean |
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener for this TransformationBean |
void |
setCleanUpResourcesOn(boolean b)
Set the flag that indicates whether the request and response objects should be set to null once the TransformationBean
is rendered. |
void |
setCustomAttributes(java.lang.String value)
Sets any custom attributes. |
void |
setDescription(java.lang.String value)
Sets the description that will be used to describe this bean to the user. |
void |
setId(java.lang.String value)
Sets the id. |
void |
setInputTransform(com.sas.util.transforms.TransformInterface transform)
Sets the input transformer to be used when setObjectData method gets called. |
void |
setLocale(java.util.Locale loc)
Set the locale |
protected void |
setLocaleDependentProperties(java.util.Locale loc)
Sets the locale dependent properties. |
void |
setName(java.lang.String value)
Deprecated. Use setId method instead |
void |
setObjectData(java.lang.Object value)
Sets the Object stored in the Object model. |
void |
setObjectDataProperty(java.lang.String property)
Sets the property name for the value to be set when setObjectData method gets called. |
void |
setOutputTransform(com.sas.util.transforms.TransformInterface transform)
Sets the output transformer to be used when getObjectData method gets called. |
void |
setRequest(javax.servlet.http.HttpServletRequest request)
Sets the request object. |
void |
setResponse(javax.servlet.http.HttpServletResponse response)
Sets the response object. |
void |
setTagEpilog(java.lang.String epilog)
Sets a string to be written after to any tag information |
void |
setTagProlog(java.lang.String prolog)
Sets a string to be written prior to any tag information |
void |
setVisible(boolean b)
Sets the visibility parameter for a tbean. |
java.lang.String |
toString()
Returns a string representation of this transformation bean. |
void |
write(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Writes the transformed representation of the object. |
void |
write(java.io.OutputStream out)
Writes the transformed representation of the object. |
void |
write(java.io.PrintWriter out)
Writes the custom attributes of the object. |
void |
write(java.io.Writer out)
Writes the transformed representation of the object. |
Constructor Detail |
---|
public BaseTransformation()
Method Detail |
---|
public void setId(java.lang.String value)
setId
in interface TransformationInterface
value
- The idpublic java.lang.String getId()
getId
in interface TransformationInterface
public void setName(java.lang.String value)
setName
in interface TransformationInterface
value
- The namesetId(java.lang.String)
public java.lang.String getName()
getName
in interface TransformationInterface
getId()
public void setDescription(java.lang.String value)
setDescription
in interface TransformationInterface
desc
- The descriptionpublic java.lang.String getDescription()
getDescription
in interface TransformationInterface
public void write(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
write
in interface TransformationInterface
req
- The request objectresp
- The response object
javax.servlet.ServletException
- Thrown if some type of servlet
error occurs
java.io.IOException
- Thrown if some type of I/O error occurspublic void write(java.io.Writer out) throws java.io.IOException
write
in interface TransformationInterface
out
- The output stream
java.io.IOException
- Thrown if some type of I/O error occurspublic void write(java.io.PrintWriter out) throws java.io.IOException
write
in interface TransformationInterface
write
in interface com.sas.util.WriteToPrintWriterInterface
out
- The output stream
java.io.IOException
- Thrown if some type of I/O error occurspublic void write(java.io.OutputStream out) throws java.io.IOException
write
in interface TransformationInterface
out
- The output stream
java.io.IOException
- Thrown if some type of I/O error occurspublic void setRequest(javax.servlet.http.HttpServletRequest request)
setRequest
in interface TransformationInterface
request
- The request objectpublic javax.servlet.http.HttpServletRequest getRequest()
getRequest
in interface TransformationInterface
public void setResponse(javax.servlet.http.HttpServletResponse response)
setResponse
in interface TransformationInterface
response
- The response objectpublic javax.servlet.http.HttpServletResponse getResponse()
getResponse
in interface TransformationInterface
public java.lang.String toString()
Note that the toString() method on this class and subclasses calls the write
method, which may have undesirable side effects. The request and response objects are set to null, and these objects are often necessary for the proper functioning of the subsequest write
method. Actions on the ActionProvider will not work. Debuggers often use toString() to show the value of a variable, and this may cause unexpected behavior while debugging
toString
in class java.lang.Object
public void setCustomAttributes(java.lang.String value)
setCustomAttributes
in interface TransformationInterface
value
- The custom attributepublic java.lang.String getCustomAttributes()
getCustomAttributes
in interface TransformationInterface
public java.lang.String getTagProlog()
getTagProlog
in interface TransformationInterface
TransformationInterface.setTagProlog(String)
public void setTagProlog(java.lang.String prolog)
setTagProlog
in interface TransformationInterface
prolog
- string to be written prior to any tag informationpublic java.lang.String getTagEpilog()
getTagEpilog
in interface TransformationInterface
public void setTagEpilog(java.lang.String epilog)
setTagEpilog
in interface TransformationInterface
epilog
- string to be written after to any tag informationpublic void setLocale(java.util.Locale loc)
setLocale
in interface TransformationInterface
locale
- public java.util.Locale getLocale()
getLocale
in interface TransformationInterface
protected void setLocaleDependentProperties(java.util.Locale loc)
localProperties
- the locale dependent properties.public void setObjectData(java.lang.Object value)
setObjectData
in interface com.sas.lang.ObjectDataInterface
value
- The selectedItempublic java.lang.Object getObjectData()
getObjectData
in interface com.sas.lang.ObjectDataInterface
public void setObjectDataProperty(java.lang.String property)
setObjectDataProperty
in interface RenderableInterface
property
- The objectDataPropertypublic java.lang.String getObjectDataProperty()
getObjectDataProperty
in interface RenderableInterface
public void setInputTransform(com.sas.util.transforms.TransformInterface transform)
setInputTransform
in interface RenderableInterface
transform
- The inputTransformpublic com.sas.util.transforms.TransformInterface getInputTransform()
getInputTransform
in interface RenderableInterface
public void setOutputTransform(com.sas.util.transforms.TransformInterface transform)
setOutputTransform
in interface RenderableInterface
transform
- The outputTransformpublic com.sas.util.transforms.TransformInterface getOutputTransform()
getOutputTransform
in interface RenderableInterface
public void setVisible(boolean b)
setVisible
in interface TransformationInterface
b
- true to display the tbean, false otherwise.public boolean isVisible()
isVisible
in interface TransformationInterface
public void setCleanUpResourcesOn(boolean b)
TransformationBean
is rendered. The flag is
true
by
default. This flag allows an
application to control this
setting in cases where the cleanup
should be delayed.
b
- set to true
by defaultisCleanUpResourcesOn()
public boolean isCleanUpResourcesOn()
TransformationBean
is rendered.
true
returned
by default#setCleanupResourcesOn(boolean)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface com.sas.beans.PropertyChangeSource
listener
- The listenerpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface com.sas.beans.PropertyChangeSource
listener
- The listenerpublic void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
listener
- The listenerpropertyName
- The propertypublic void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
listener
- The listenerpropertyName
- The propertypublic void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
propertyName
- Name of the propertyoldValue
- Old value of propertynewValue
- New value of propertypublic void firePropertyChange(java.lang.String propertyName, int oldValue, int newValue)
propertyName
- Name of the propertyoldValue
- Old value of propertynewValue
- New value of propertypublic void firePropertyChange(java.lang.String propertyName, boolean oldValue, boolean newValue)
propertyName
- Name of the propertyoldValue
- Old value of propertynewValue
- New value of propertypublic void firePropertyChange(java.beans.PropertyChangeEvent evt)
propertyName
- Name of the propertyevt
- The PropertyChangeEvent to firepublic boolean hasListeners(java.lang.String propertyName)
propertyName
- Name of the property to check
public void cleanUpResources()
request
and response
. This method
calls the setRequest and setResponse methods with a null value.
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |