public class StoreAppender extends Object
Constructor and Description |
---|
StoreAppender() |
Modifier and Type | Method and Description |
---|---|
String |
convertStr(String input)
Given a string, this method replaces all occurrences of '<', '>',
'&', and '"'.
|
Object |
defaultInstance(Object bean)
Generate default Instance for the specified bean.
|
protected boolean |
isPersistable(Class<?> clazz)
Is the specified property type one for which we should generate a
persistence attribute?
|
boolean |
isPrintValue(Object bean,
Object bean2,
String attrName,
StoreDescription desc)
Determine if the attribute value needs to be stored.
|
protected void |
printAttribute(PrintWriter writer,
int indent,
Object bean,
StoreDescription desc,
String attributeName,
Object bean2,
Object value)
Store the specified of the specified JavaBean.
|
void |
printAttributes(PrintWriter writer,
int indent,
boolean include,
Object bean,
StoreDescription desc)
Store the relevant attributes of the specified JavaBean.
|
void |
printAttributes(PrintWriter writer,
int indent,
Object bean,
StoreDescription desc)
Store the relevant attributes of the specified JavaBean, plus a
className attribute defining the fully qualified Java
class name of the bean. |
void |
printCloseTag(PrintWriter aWriter,
StoreDescription aDesc)
Print the closing tag.
|
void |
printIndent(PrintWriter aWriter,
int indent)
Print some spaces.
|
void |
printOpenTag(PrintWriter aWriter,
int indent,
Object bean,
StoreDescription aDesc)
Print only the open tag with all attributes.
|
void |
printTag(PrintWriter aWriter,
int indent,
Object bean,
StoreDescription aDesc)
Print tag with all attributes
|
void |
printTagArray(PrintWriter aWriter,
String tag,
int indent,
String[] elements)
Print an array of elements.
|
void |
printTagContent(PrintWriter aWriter,
String tag,
String content)
Print the value from tag as content.
|
void |
printTagValueArray(PrintWriter aWriter,
String tag,
int indent,
String[] elements)
Print an array of values.
|
void |
printValue(PrintWriter writer,
int indent,
String name,
Object value)
Print an attribute value.
|
public void printCloseTag(PrintWriter aWriter, StoreDescription aDesc) throws Exception
aWriter
- The output writeraDesc
- Store description of the current elementException
- A store error occurredpublic void printOpenTag(PrintWriter aWriter, int indent, Object bean, StoreDescription aDesc) throws Exception
aWriter
- The output writerindent
- Indentation levelbean
- The current bean that is storedaDesc
- Store description of the current elementException
- A store error occurredpublic void printTag(PrintWriter aWriter, int indent, Object bean, StoreDescription aDesc) throws Exception
aWriter
- The output writerindent
- Indentation levelbean
- The current bean that is storedaDesc
- Store description of the current elementException
- A store error occurredpublic void printTagContent(PrintWriter aWriter, String tag, String content) throws Exception
aWriter
- The output writertag
- The element namecontent
- Element contentException
- A store error occurredpublic void printTagValueArray(PrintWriter aWriter, String tag, int indent, String[] elements)
aWriter
- The output writertag
- The element nameindent
- Indentation levelelements
- Array of element valuespublic void printTagArray(PrintWriter aWriter, String tag, int indent, String[] elements) throws Exception
aWriter
- The output writertag
- The element nameindent
- Indentation levelelements
- Array of elementsException
- Store error occurredpublic void printIndent(PrintWriter aWriter, int indent)
aWriter
- The output writerindent
- The number of spacespublic void printAttributes(PrintWriter writer, int indent, Object bean, StoreDescription desc) throws Exception
className
attribute defining the fully qualified Java
class name of the bean.writer
- PrintWriter to which we are storingindent
- Indentation levelbean
- Bean whose properties are to be rendered as attributes,desc
- Store description of the current elementException
- if an exception occurs while storingpublic void printAttributes(PrintWriter writer, int indent, boolean include, Object bean, StoreDescription desc) throws Exception
writer
- PrintWriter to which we are storingindent
- Indentation levelinclude
- Should we include a className
attribute?bean
- Bean whose properties are to be rendered as attributes,desc
- RegistryDescrpitor from this beanException
- if an exception occurs while storingprotected void printAttribute(PrintWriter writer, int indent, Object bean, StoreDescription desc, String attributeName, Object bean2, Object value)
writer
- PrintWriter to which we are storingindent
- Indentation levelbean
- The current beandesc
- RegistryDescrpitor from this beanattributeName
- The attribute name to storebean2
- A default instance of the bean for comparisonvalue
- The attribute valuepublic boolean isPrintValue(Object bean, Object bean2, String attrName, StoreDescription desc)
bean
- orginal beanbean2
- default beanattrName
- attribute namedesc
- StoreDescription from beantrue
if the value should be storedpublic Object defaultInstance(Object bean) throws InstantiationException, IllegalAccessException
bean
- The beanInstantiationException
- Error creating a new instanceIllegalAccessException
- Another error occurredpublic void printValue(PrintWriter writer, int indent, String name, Object value)
writer
- PrintWriter to which we are storingindent
- Indentation levelname
- Attribute namevalue
- Attribute valuepublic String convertStr(String input)
input
- The string to escapeprotected boolean isPersistable(Class<?> clazz)
clazz
- Java class to be testedtrue
if the specified class should be storedCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.