public class BeanProp extends Object implements BaseProperty
| Type | Property and Description |
|---|---|
boolean |
isChoice
Gets the value of the property choiceProperty.
|
BaseProperty.VetoException| Modifier and Type | Field and Description |
|---|---|
String |
beanName |
String |
dtdName |
Class |
propClass |
int |
type |
INSTANCE_MANDATORY_ARRAY, INSTANCE_MANDATORY_ELT, INSTANCE_OPTIONAL_ARRAY, INSTANCE_OPTIONAL_ELT| Constructor and Description |
|---|
BeanProp(BaseBean bean,
String dtdName,
String beanName,
int type,
Class propClass) |
BeanProp(BaseBean bean,
String dtdName,
String beanName,
int type,
Class propClass,
boolean isRoot) |
BeanProp(BaseBean bean,
String dtdName,
String beanName,
int type,
Class propClass,
boolean isRoot,
int initialCapacity) |
BeanProp(BaseBean bean,
String dtdName,
String beanName,
int type,
Class propClass,
int initialCapacity) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addKnownValue(Object value) |
void |
addPCListener(PropertyChangeListener l)
Book-keeping of the listeners
|
int |
addValue(Object value)
Add a value at the end of the indexed property
|
void |
addVCListener(VetoableChangeListener l) |
protected int |
bindingsSize() |
void |
createAttribute(String dtdName,
String name,
int type,
String[] values,
String defValue)
Attributes definition live in the BeanProp object while attribute
values live in the DOMBinding objects.
|
void |
createTransientAttribute(String dtdName)
When the bean tree is built from an XML document and an attribute
not defined in the DTD is found, the attribute is dynamically added
to the list of defined attribute with the TRANSIENT status.
|
String[] |
getAttributeNames()
Misc: returns an array of the attribute names
|
BaseAttribute[] |
getAttributes()
Misc: convert the ArrayList into an array of AttrProp
|
String |
getAttributeValue(int index,
String name)
Get the attribute value
|
AttrProp |
getAttrProp(String name)
Misc: return the property of name 'name'
|
AttrProp |
getAttrProp(String name,
boolean quiet)
Return the property name AttrProp
|
BaseBean |
getBean() |
String |
getBeanName() |
BaseProperty[] |
getChoiceProperties()
If this property is a choice property, returns all other choice
properties associated to this one (including this one).
|
String |
getDtdName()
Return the dtd name of the property, as it appears in the DTD file.
|
String |
getFullName() |
String |
getFullName(int index)
Returns the full path name of the property (unique String name
identifying the property for the lifetime of the graph).
|
int |
getInstanceType()
Returns the instanciation type of the property.
|
String |
getName()
Return the name of the property as it is used in the bean class.
|
protected Object[] |
getObjectArray(int extraElements) |
BaseBean |
getParent()
Return the BaseBean for this property if there is one
|
Class |
getPropClass() |
Class |
getPropertyClass()
Return the class type of the property.
|
int |
getType() |
Object |
getValue(int index) |
Object |
getValueById(int id)
Return the element which as the unique DOMBinding identifier id
(Every DOMBinding has a unique identifier which identifies uniquely
the DOM element referenced by the DOMBinding object.
|
Object[] |
getValues()
If the property is an indexed property, return all the values
as an array of its type.
|
boolean |
hasName(String name)
Return true if the name is either equals to getName() or getDtdName()
|
int |
idToIndex(int id)
Convert a unique DOMBinding Id into a relative index value
This method may return -1 if we cannot figure out the index.
|
int |
indexToId(int index)
Convert the relative index value (the property index value) into
the unique DOMBinding id.
|
void |
initialize()
Called by the BaseBean class when the property is fully created.
|
boolean |
isBean()
Return true if the property is a bean (a node in the graph).
|
boolean |
isChoiceProperty()
Gets the value of the property choiceProperty.
|
boolean |
isIndexed()
Return true if the property is an indexed property.
|
boolean |
isKey()
Return true if this property matters when schema2beans compare graphs
|
boolean |
isRoot()
Return true if this is the root property
|
Object[] |
knownValues() |
DOMBinding |
registerDomNode(Node node,
DOMBinding binding,
BaseBean bean)
This method is called to associate this bean property to a DOM Node.
|
void |
removePCListener(PropertyChangeListener l) |
void |
removeValue(int index) |
int |
removeValue(Object value)
Remove the object that have the bean value (.equals call)
removeValue do not leave null slots as the setValue does.
|
void |
removeVCListener(VetoableChangeListener l) |
void |
setAttributeValue(int index,
String name,
String value)
Set the value of the attribute
|
protected int |
setElement(int index,
Object value,
boolean add)
Different cases might happen in this method, depending on the
type of the property, if the property is an array or not,
and also depending on the type of the value parameter.
|
void |
setValue(int index,
Object value)
Set the value for one element of an indexed property
|
void |
setValue(Object[] value)
Set the whole index property.
|
int |
size()
If the property is an indexed property, return the number of element
(might contain null elements).
|
String |
toString() |
public boolean isChoiceProperty
isChoiceProperty in interface BasePropertypublic String dtdName
public String beanName
public int type
public Class propClass
public BeanProp(BaseBean bean, String dtdName, String beanName, int type, Class propClass, int initialCapacity)
public BeanProp(BaseBean bean, String dtdName, String beanName, int type, Class propClass, boolean isRoot)
public void initialize()
public Class getPropClass()
public int getType()
public String getBeanName()
public BaseBean getBean()
public BaseBean getParent()
BasePropertygetParent in interface BasePropertyprotected int bindingsSize()
public Object getValue(int index)
public Object getValueById(int id)
public int indexToId(int index)
public int idToIndex(int id)
protected Object[] getObjectArray(int extraElements)
public Object[] getValues()
public void setValue(Object[] value)
public void setValue(int index,
Object value)
public int addValue(Object value)
public int removeValue(Object value)
public void removeValue(int index)
protected int setElement(int index,
Object value,
boolean add)
public Object[] knownValues()
protected void addKnownValue(Object value)
public void createAttribute(String dtdName, String name, int type, String[] values, String defValue)
public void createTransientAttribute(String dtdName)
public BaseAttribute[] getAttributes()
getAttributes in interface BasePropertypublic String[] getAttributeNames()
getAttributeNames in interface BasePropertypublic AttrProp getAttrProp(String name, boolean quiet)
public void setAttributeValue(int index,
String name,
String value)
public void addPCListener(PropertyChangeListener l)
public void removePCListener(PropertyChangeListener l)
public void addVCListener(VetoableChangeListener l)
public void removeVCListener(VetoableChangeListener l)
public DOMBinding registerDomNode(Node node, DOMBinding binding, BaseBean bean) throws Schema2BeansException
Schema2BeansExceptionpublic boolean isRoot()
BasePropertyisRoot in interface BasePropertypublic String getName()
BasePropertygetName in interface BasePropertypublic String getDtdName()
BasePropertygetDtdName in interface BasePropertypublic boolean isIndexed()
BasePropertyisIndexed in interface BasePropertypublic Class getPropertyClass()
BasePropertygetPropertyClass in interface BasePropertypublic boolean isBean()
BasePropertyisBean in interface BasePropertypublic int size()
BasePropertysize in interface BasePropertypublic String getFullName(int index)
BasePropertygetFullName in interface BasePropertypublic String getFullName()
getFullName in interface BasePropertypublic int getInstanceType()
BasePropertygetInstanceType in interface BasePropertypublic boolean isChoiceProperty()
isChoiceProperty in interface BasePropertypublic BaseProperty[] getChoiceProperties()
BasePropertygetChoiceProperties in interface BasePropertypublic boolean hasName(String name)
BasePropertyhasName in interface BasePropertypublic boolean isKey()
BasePropertyisKey in interface BasePropertyCopyright © 2017–2019 Eclipse Foundation. All rights reserved.