public class AttributeStorage
extends java.lang.Object
Constructor and Description |
---|
AttributeStorage(AttributeStorageDefinition definition)
Constructor
|
AttributeStorage(AttributeStorageDefinition asd,
org.jdom.Element element)
This constructor the same as creating an AttributeStorage for the ASD then calling loadFromElement.
|
AttributeStorage(java.lang.String[] names,
AttributeClass[] storage)
Helper Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
clear(java.lang.String attrName)
remove a definition of an attribute
|
void |
copyFromStorage(AttributeStorage attr)
Copy all values from the storage that apply to this storage.
|
java.lang.Object |
get(int n)
Return the value for the n'th attribute.
|
java.lang.Object |
get(java.lang.String attrName)
Only this get method can be overridden.
|
AttributeClass |
getAttrClass(java.lang.String attr)
Return the storage class for an attribute.
|
java.lang.Boolean |
getBoolean(java.lang.String attrName) |
java.lang.String |
getCommaLine()
Give the values of the attributes in a comma separated line.
|
AttributeStorageDefinition |
getDefinition() |
java.lang.Double |
getDouble(java.lang.String attrName) |
java.lang.Integer |
getInt(java.lang.String attrName) |
java.lang.Long |
getLong(java.lang.String attrName) |
java.util.Iterator<java.lang.String> |
getNameIterator() |
java.util.Set<java.lang.String> |
getSetAttr()
Returns the set of attribute names which have values.
|
java.lang.String |
getString(java.lang.String attrName) |
java.sql.Timestamp |
getTimestamp(java.lang.String attrName) |
java.lang.Object[] |
getValues() |
boolean |
hasAttribute(java.lang.String attrName)
Is there an attribute defined with this name? This checks that
there is an attribute, not if it has a value or not.
|
int |
hashCode() |
boolean |
hasNoValues()
Does this AS storage any values.
|
boolean |
isSet(java.lang.String attrName) |
void |
loadFromElement(org.jdom.Element fromElement)
Load attributes from an XML Element.
|
void |
loadFromResultSet(java.sql.ResultSet rs) |
void |
saveToElement(org.jdom.Element toElement) |
void |
saveToElement(java.lang.String[] columnDefAttributes,
org.jdom.Element toElement)
This version takes a list of attributes to save
|
void |
set(java.lang.String attrName,
java.lang.Object value)
Set an attribute a value from an object.
|
void |
setWithIgnore(java.lang.String string,
java.lang.Object object) |
int |
size()
Size of the storage.
|
java.lang.String |
toString() |
public AttributeStorage(java.lang.String[] names, AttributeClass[] storage)
names
- The names of the attributesstorage
- How to store the attribute values.public AttributeStorage(AttributeStorageDefinition definition)
definition
- Definition data.public AttributeStorage(AttributeStorageDefinition asd, org.jdom.Element element)
asd
- Used to define the AttributeStorage element.seqRow
- Values immediately loaded from here.This method used to load the values.
public void set(java.lang.String attrName, java.lang.Object value)
attrName
- value
- The value is converted to the
storage class of the attribute.java.lang.Exception
- If the attribute name isn't one specified in the constructor.java.lang.Exception
- The object cannot be converted to a storage class for the attribute.public java.lang.Object get(java.lang.String attrName)
public final java.lang.Integer getInt(java.lang.String attrName)
public final java.lang.Boolean getBoolean(java.lang.String attrName)
public final java.lang.Double getDouble(java.lang.String attrName)
public final java.lang.Long getLong(java.lang.String attrName)
public final java.lang.String getString(java.lang.String attrName)
public boolean isSet(java.lang.String attrName)
public void clear(java.lang.String attrName)
public void loadFromElement(org.jdom.Element fromElement)
fromElement
- public void saveToElement(org.jdom.Element toElement)
data
- public void saveToElement(java.lang.String[] columnDefAttributes, org.jdom.Element toElement)
columnDefAttributes
- The attributes to save.columndef
- The Element to save the attributes to.public int size()
public java.util.Set<java.lang.String> getSetAttr()
public void setWithIgnore(java.lang.String string, java.lang.Object object)
string
- object
- public void copyFromStorage(AttributeStorage attr)
attr
- public void loadFromResultSet(java.sql.ResultSet rs) throws java.sql.SQLException
rs
- java.sql.SQLException
public boolean hasAttribute(java.lang.String attrName)
attrName
- The name of the attribute to check for.This method returns whether a defined attribute has a value
public AttributeClass getAttrClass(java.lang.String attr)
attr
- The name of the attributepublic java.util.Iterator<java.lang.String> getNameIterator()
public java.lang.Object[] getValues()
public AttributeStorageDefinition getDefinition()
public java.lang.String getCommaLine()
public java.sql.Timestamp getTimestamp(java.lang.String attrName)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean hasNoValues()
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Object get(int n)
n
-