|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.w3c.tools.resources.upgrade.Attribute org.w3c.tools.resources.upgrade.ObjectAttribute
public class ObjectAttribute
A generic Object attribute. This attribute is usefull for attributes that are:
Field Summary | |
---|---|
protected java.lang.Class |
cls
The class for values of this attribute. |
Fields inherited from class org.w3c.tools.resources.upgrade.Attribute |
---|
COMPUTED, DONTSAVE, EDITABLE, flags, MANDATORY, name, type |
Constructor Summary | |
---|---|
ObjectAttribute(java.lang.String name,
java.lang.Class cls,
java.lang.Object def,
java.lang.Integer flags)
Create a new ObjectAttribute instance. |
|
ObjectAttribute(java.lang.String name,
java.lang.String cname,
java.lang.Object def,
java.lang.Integer flags)
Create a new ObjectAttribute instance. |
Method Summary | |
---|---|
boolean |
checkValue(java.lang.Object value)
Check that a value is allowed for this attribute. |
int |
getPickleLength(java.lang.Object value)
Get the number of bytes required to save that attribute value. |
void |
pickle(java.io.DataOutputStream out,
java.lang.Object obj)
The ObjectAttribute values can't be pickled. |
java.lang.Object |
unpickle(java.io.DataInputStream in)
The ObjectAttribute values can't be unpickled. |
Methods inherited from class org.w3c.tools.resources.upgrade.Attribute |
---|
checkFlag, getDefault, getName, getType, stringify |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.Class cls
Constructor Detail |
---|
public ObjectAttribute(java.lang.String name, java.lang.Class cls, java.lang.Object def, java.lang.Integer flags)
name
- The name of the attribute.cls
- The class for this attribute values.def
- The default value for this attribute.flags
- The attribute flags.public ObjectAttribute(java.lang.String name, java.lang.String cname, java.lang.Object def, java.lang.Integer flags)
name
- The name of the attribute.cname
- The name class for this attribute values.def
- The default value for this attribute.flags
- The attribute flags.
java.lang.RuntimeException
- If we couldn't resolve the class name.Method Detail |
---|
public boolean checkValue(java.lang.Object value)
checkValue
in class Attribute
value
- The value to check.
public final int getPickleLength(java.lang.Object value)
getPickleLength
in class Attribute
The
- value about to be pickled.
java.lang.RuntimeException
- Always throw since ObjectAttribute
can't be pickled.public void pickle(java.io.DataOutputStream out, java.lang.Object obj)
pickle
in class Attribute
out
- The DataOutputStream to dump the object to.obj
- The object to pickle.public java.lang.Object unpickle(java.io.DataInputStream in)
unpickle
in class Attribute
in
- The DataInputStream to read from.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |