public abstract class BaseBean extends Object implements Cloneable, Bean
| Type | Property and Description |
|---|---|
boolean |
isChoice
Gets the value of the property choiceProperty.
|
| Modifier and Type | Class and Description |
|---|---|
class |
BaseBean.IterateChoiceProperties |
| Modifier and Type | Field and Description |
|---|---|
protected DOMBinding |
binding |
protected GraphManager |
graphManager |
static int |
MERGE_COMPARE |
static int |
MERGE_INTERSECT |
static int |
MERGE_NONE
Merge the bean tree with ourself
Let's define:
G1 the current graph and G2 the new graph we want to merge
E1 the set of element of G1 that don't exist anymore in G2.
|
static int |
MERGE_UNION |
static int |
MERGE_UPDATE |
| Constructor and Description |
|---|
BaseBean(Vector comps,
Version version) |
| Modifier and Type | Method and Description |
|---|---|
Bean |
_getParent() |
Bean |
_getRoot()
Return the root of the graph.
|
String |
_getXPathExpr() |
String |
_getXPathExpr(Object childObj) |
void |
_setChanged(boolean changed) |
void |
addBeanComparator(BeanComparator cmp) |
Comment |
addComment(String comment)
The new comment will be added to the first of the bean's children.
|
protected void |
addKnownValue(String name,
Object value) |
void |
addPropertyChangeListener(PropertyChangeListener l) |
void |
addPropertyChangeListener(String n,
PropertyChangeListener l) |
protected int |
addValue(BeanProp prop,
Object value) |
int |
addValue(String name,
Object value)
Add a value to the indexed property named name.
|
BeanProp |
beanProp()
Return the BeanProp object where this bean belongs.
|
BeanProp |
beanProp(int order)
Return the internal object representation of the property.
|
BeanProp |
beanProp(String name)
Return the internal object representation of the property.
|
BeanProp[] |
beanProps()
Returns the list of properties of this bean as an array.
|
protected Iterator |
beanPropsIterator()
Returns the list of properties of this bean as an array.
|
protected void |
buildPathName(StringBuffer str)
Build the current path up to the root node.
|
void |
changeDocType(String publicId,
String systemId) |
BaseBean[] |
childBeans(boolean recursive) |
void |
childBeans(boolean recursive,
List beans)
Store all child beans into @param beans.
|
Object |
clone()
Process a deep clone() of the current bean
|
Comment[] |
comments() |
protected void |
copyProperty(BeanProp prop,
BaseBean bean,
int index,
Object value) |
void |
createAttribute(String dtdName,
String name,
int type,
String[] values,
String defValue)
Create a new attribute on the current bean.
|
void |
createAttribute(String propName,
String dtdName,
String name,
int type,
String[] values,
String defValue)
Create a new attribute for the property propertyName.
|
void |
createBean(Node node,
GraphManager mgr) |
static BaseBean |
createGraph(Class clazz,
InputStream in)
Create the schema2beans graph of root bean clazz, from the input stream.
|
static BaseBean |
createGraph(Class clazz,
InputStream in,
boolean validate)
Create the schema2beans graph of root bean clazz, from the input stream
in using the validate option.
|
static BaseBean |
createGraph(Class clazz,
InputStream in,
boolean validate,
EntityResolver er)
Create the schema2beans graph of root bean clazz, from the input stream
in using the validate option and the entity resolver er.
|
static BaseBean |
createGraph(Class clazz,
InputStream in,
boolean validate,
EntityResolver er,
ErrorHandler eh)
Create the schema2beans graph of root bean clazz, from the input stream in
and using the validate, er and sh options.
|
void |
createProperty(String dtdName,
String beanName,
Class type)
Create a new property for the current bean, selecting default option
values.
|
void |
createProperty(String dtdName,
String beanName,
int option,
Class type)
Create a new property for the current bean.
|
void |
createRoot(String dtdName,
String beanName,
int option,
Class type)
Create the root element of the graph
|
protected DOMBinding |
domBinding() |
String |
dtdName()
Return the DTD name of this schema2beans graph node.
|
abstract void |
dump(StringBuffer str,
String indent) |
void |
dumpAttributes(String name,
int index,
StringBuffer str,
String indent) |
String |
dumpBeanNode() |
String |
dumpDomNode() |
String |
dumpDomNode(int depth) |
String |
dumpDomNode(String nodeName,
int depth)
Dump the DOM content of this bean.
|
void |
dumpXml() |
String[] |
findAttributeValue(String attrName,
String value)
Search for a specific attribute name/value.
|
String[] |
findPropertyValue(String propName,
Object value)
Search for a specfic property name/value.
|
String[] |
findValue(Object value)
Search for any property or attribute of the specified value.
|
String |
fullName()
Return the path name of this element in the graph.
|
String[] |
getAttributeNames()
Return the list of all known attribute names for the current bean
|
String[] |
getAttributeNames(String propName)
Return the list of all known attribute names for this property
(even if they are not set).
|
String |
getAttributeValue(String name)
Get the attribute value on the current property bean.
|
String |
getAttributeValue(String propName,
int index,
String name)
Get the attribute value (see BeanProp class)
|
String |
getAttributeValue(String propName,
String name)
Get the attribute value (see BeanProp class)
|
String |
getDefaultNamespace() |
BaseProperty |
getProperty()
Return the BaseProperty object for the current bean
|
BaseProperty |
getProperty(String propName)
Return the BaseProperty object for the specified property
|
Object |
getValue(String name)
Return the value of the single property named name.
|
Object |
getValue(String name,
int index)
Return one element of the indexed property named name.
|
Object |
getValueById(String name,
int id)
Return one element of the index property using the internal
id index value.
|
Object[] |
getValues(String name)
Return the values of the indexed property named name.
|
GraphManager |
graphManager()
Return the unique graphManager instance of the schema2beans graph
|
protected boolean |
hasDomNode() |
boolean |
hasName(String name) |
int |
idToIndex(String name,
int id)
Convert an unique internal index value into the user visible
index value.
|
int |
indexOf(String name,
Object value)
Returns the position of the indexed property element.
|
int |
indexToId(String name,
int index)
Convert the user index value into the internal unique index value.
|
protected void |
init(Vector comps,
Version version) |
protected void |
initPropertyTables(int propertyCount) |
boolean |
isChoiceProperty()
Gets the value of the property choiceProperty.
|
boolean |
isChoiceProperty(String name)
Return true if the property name is a choice property (defined
in the DTD with the | char, such as (a | b | c ...)
|
boolean |
isEqualTo(Object obj)
Perform a deep recursive comparison.
|
boolean |
isNull(String name)
Return true if this property is null
|
boolean |
isNull(String name,
int index)
Return true if this property is null
|
boolean |
isRoot()
Return true if this element is the root of the schema2beans tree.
|
Object[] |
knownValues(String name)
Return the known values as declared in the mdd file.
|
BaseAttribute[] |
listAttributes()
Return the list of all known attribute names for the current bean
|
BaseAttribute[] |
listAttributes(String propName)
Return the list of all known attribute names for this property
(even if they are not set).
|
Iterator |
listChoiceProperties()
Returns an iterator on the list of the sets of choice properties.
|
BaseProperty[] |
listChoiceProperties(String name)
If the property name is a choice property, returns the list of
all the properties associated to this property (this one included).
|
BaseProperty[] |
listProperties()
Return the list of the properties
|
void |
merge(BaseBean bean)
Merge the bean tree with the current graph using the default
merging option.
|
void |
merge(BaseBean bean,
int mode)
Merge the specified bean schema2beans graph into the current graph using
the specified mode.
|
void |
mergeUpdate(BaseBean sourceBean)
Same as merge(BaseBean bean).
|
String |
name()
Return the bean name of this schema2beans graph node.
|
String |
nameChild(Object childObj) |
String |
nameChild(Object childObj,
boolean returnConstName,
boolean returnSchemaName) |
String |
nameChild(Object childObj,
boolean returnConstName,
boolean returnSchemaName,
boolean returnXPathName) |
String |
nameSelf() |
BaseBean |
newInstance(String name)
Return a new instance of the specified bean property
|
BaseBean |
parent()
Return the BaseBean parent of the current bean.
|
Bean |
propertyById(String name,
int id)
Get the bean using its unique identifier.
|
void |
reindent()
Rearrange the internal whitespace so that when it gets printed
out, it looks pretty.
|
void |
reindent(String indent) |
void |
removeBeanComparator(BeanComparator cmp) |
void |
removeComment(Comment comment)
Remove @param comment from this bean.
|
void |
removePropertyChangeListener(PropertyChangeListener l) |
void |
removePropertyChangeListener(String n,
PropertyChangeListener l) |
protected void |
removeValue(BeanProp prop,
int index) |
protected int |
removeValue(BeanProp prop,
Object value) |
void |
removeValue(String name,
int index)
Remove a value from the indexed property named name.
|
int |
removeValue(String name,
Object value)
Remove a value from the indexed property named name.
|
void |
setAttributeValue(String propName,
int index,
String name,
String value)
Set the value of the attribute (see the BeanClass class)
|
void |
setAttributeValue(String name,
String value)
Set the attribute value on the current property bean
|
void |
setAttributeValue(String propName,
String name,
String value)
Set the value of the attribute (see the BeanClass class)
|
void |
setDefaultNamespace(String namespace) |
protected void |
setDomBinding(DOMBinding binding) |
protected void |
setGraphManager(GraphManager graphMgr) |
protected void |
setValue(BeanProp prop,
int index,
Object value) |
void |
setValue(String name,
int index,
Object value)
Set the value of an element for the indexed property named name.
|
void |
setValue(String name,
Object value)
Set the value for the single property named name.
|
void |
setValue(String name,
Object[] value)
Set the values for the indexed property named name.
|
void |
setValueById(String name,
int id,
Object value)
Set the value of an element for the indexed property named name,
using the unique internal index.
|
int |
size(String name)
Return the size of the indexed property named name (the size
might be greater than the number of elements if the indexed
property array contains null elements).
|
String |
toString() |
void |
write(File f) |
void |
write(OutputStream out)
Write the current schema2beans graph as an XML document.
|
void |
write(OutputStream out,
String encoding)
Write the current schema2beans graph as an XML document.
|
void |
write(Writer w)
If you call this method, you're responsible for setting up the
right encoding for the Writer @param w.
|
void |
write(Writer w,
String encoding)
If you call this method, you're responsible for setting up the
right encoding for the Writer @param w.
|
void |
writeNode(Writer out) |
void |
writeNoReindent(OutputStream out) |
public boolean isChoiceProperty
protected DOMBinding binding
protected GraphManager graphManager
public static final int MERGE_NONE
public static final int MERGE_INTERSECT
public static final int MERGE_UNION
public static final int MERGE_UPDATE
public static final int MERGE_COMPARE
protected void initPropertyTables(int propertyCount)
public void addBeanComparator(BeanComparator cmp)
public void removeBeanComparator(BeanComparator cmp)
public void createProperty(String dtdName, String beanName, Class type)
public void createRoot(String dtdName, String beanName, int option, Class type) throws Schema2BeansRuntimeException
Schema2BeansRuntimeExceptionpublic void createProperty(String dtdName, String beanName, int option, Class type) throws Schema2BeansRuntimeException
Schema2BeansRuntimeExceptionpublic void setDefaultNamespace(String namespace)
public String getDefaultNamespace()
public BeanProp[] beanProps()
protected Iterator beanPropsIterator()
public BeanProp beanProp(String name)
public BeanProp beanProp(int order)
public Object getValue(String name, int index)
public Object getValueById(String name, int id)
getValueById in interface Beanpublic int idToIndex(String name, int id)
public int indexToId(String name, int index)
public boolean isNull(String name)
public boolean isNull(String name, int index)
public Object[] getValues(String name)
public void setValue(String name, Object value)
public void setValue(String name, int index, Object value)
protected void removeValue(BeanProp prop, int index)
public void setValueById(String name, int id, Object value)
setValueById in interface Beanpublic void setValue(String name, Object[] value)
public int addValue(String name, Object value)
public int removeValue(String name, Object value)
removeValue in interface Beanpublic void removeValue(String name, int index)
public int indexOf(String name, Object value) throws Schema2BeansRuntimeException
Schema2BeansRuntimeExceptionpublic int size(String name)
public boolean isChoiceProperty(String name)
public boolean isChoiceProperty()
public BaseProperty[] listChoiceProperties(String name)
public Iterator listChoiceProperties()
public BaseProperty[] listProperties()
listProperties in interface Beanpublic BaseProperty getProperty()
getProperty in interface Beanpublic BaseProperty getProperty(String propName)
getProperty in interface Beanpublic Object[] knownValues(String name)
public void createAttribute(String dtdName, String name, int type, String[] values, String defValue)
public void createAttribute(String propName, String dtdName, String name, int type, String[] values, String defValue)
public void setAttributeValue(String propName, String name, String value)
public void setAttributeValue(String name, String value)
public String getAttributeValue(String name)
public String getAttributeValue(String propName, String name)
public void setAttributeValue(String propName, int index, String name, String value)
public String getAttributeValue(String propName, int index, String name)
public String[] getAttributeNames(String propName)
public String[] getAttributeNames()
public BaseAttribute[] listAttributes(String propName)
public BaseAttribute[] listAttributes()
public String[] findAttributeValue(String attrName, String value)
public String[] findPropertyValue(String propName, Object value)
public String[] findValue(Object value)
public void write(File f) throws IOException, Schema2BeansRuntimeException
public void write(OutputStream out) throws IOException, Schema2BeansRuntimeException
public void write(OutputStream out, String encoding) throws IOException, Schema2BeansException
IOExceptionSchema2BeansExceptionpublic void write(Writer w) throws IOException, Schema2BeansException
IOExceptionSchema2BeansExceptionpublic void write(Writer w, String encoding) throws IOException, Schema2BeansException
IOExceptionSchema2BeansExceptionpublic void writeNoReindent(OutputStream out) throws IOException, Schema2BeansException
IOExceptionSchema2BeansExceptionpublic void writeNode(Writer out) throws IOException
IOExceptionpublic void reindent()
public void reindent(String indent)
protected boolean hasDomNode()
protected DOMBinding domBinding()
protected void setDomBinding(DOMBinding binding)
public GraphManager graphManager()
protected void setGraphManager(GraphManager graphMgr)
protected void buildPathName(StringBuffer str)
public Object clone()
public void merge(BaseBean bean, int mode)
public void merge(BaseBean bean)
public void mergeUpdate(BaseBean sourceBean)
public boolean isEqualTo(Object obj)
public Bean propertyById(String name, int id)
propertyById in interface Beanpublic BeanProp beanProp()
public BaseBean parent()
public Bean _getParent()
_getParent in interface Beanpublic Bean _getRoot()
public String fullName()
public boolean isRoot()
public String name()
public String dtdName()
public void createBean(Node node, GraphManager mgr) throws Schema2BeansRuntimeException
Schema2BeansRuntimeExceptionpublic BaseBean newInstance(String name)
public abstract void dump(StringBuffer str, String indent)
public String dumpDomNode(String nodeName, int depth)
public String dumpDomNode(int depth)
public String dumpDomNode()
public String dumpBeanNode()
public void dumpAttributes(String name, int index, StringBuffer str, String indent)
public void dumpXml()
public static BaseBean createGraph(Class clazz, InputStream in) throws Schema2BeansException
Schema2BeansExceptionpublic static BaseBean createGraph(Class clazz, InputStream in, boolean validate) throws Schema2BeansException
Schema2BeansExceptionpublic static BaseBean createGraph(Class clazz, InputStream in, boolean validate, EntityResolver er) throws Schema2BeansException
Schema2BeansExceptionpublic static BaseBean createGraph(Class clazz, InputStream in, boolean validate, EntityResolver er, ErrorHandler eh) throws Schema2BeansException
Schema2BeansExceptionpublic void addPropertyChangeListener(PropertyChangeListener l)
addPropertyChangeListener in interface Beanpublic void removePropertyChangeListener(PropertyChangeListener l)
removePropertyChangeListener in interface Beanpublic void addPropertyChangeListener(String n, PropertyChangeListener l)
public void removePropertyChangeListener(String n, PropertyChangeListener l)
public Comment[] comments()
public Comment addComment(String comment)
NullPointerException - if this is a nonroot bean that is
not part of a rooted graph yet.public void removeComment(Comment comment)
public BaseBean[] childBeans(boolean recursive)
public void childBeans(boolean recursive,
List beans)
childBeans in interface Beanpublic String nameSelf()
public String nameChild(Object childObj, boolean returnConstName, boolean returnSchemaName)
public String nameChild(Object childObj, boolean returnConstName, boolean returnSchemaName, boolean returnXPathName)
public void _setChanged(boolean changed)
public String _getXPathExpr()
Copyright © 2017. All Rights Reserved.