|
|||||||||
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
public abstract class Attribute
Instances of this class describe an attribute of a resource.
Field Summary | |
---|---|
static int |
COMPUTED
Flags value - This attribute is computed from the resource state. |
static int |
DONTSAVE
Flag value - This attribute shouldn't be saved. |
static int |
EDITABLE
Flag value - This attribute is editable. |
protected int |
flags
The associated flags (see the predefined flags). |
static int |
MANDATORY
Flag value - This attribute is mandatory. |
protected java.lang.String |
name
The attribute name. |
protected java.lang.String |
type
The attribute's value type, as the name of its class. |
Constructor Summary | |
---|---|
Attribute(java.lang.String name,
java.lang.Object def,
java.lang.Integer flags)
Private constructore to create a new resource attribute description. |
Method Summary | |
---|---|
boolean |
checkFlag(int tst)
Check some flag on this attribute description. |
abstract boolean |
checkValue(java.lang.Object value)
Is the provided object a suitable value for this attribute ? If so, store it into the given store. |
java.lang.Object |
getDefault()
Get this attribute default value. |
java.lang.String |
getName()
Get this attribute name. |
abstract int |
getPickleLength(java.lang.Object value)
Get number of bytes needed to pickle that attribute. |
java.lang.String |
getType()
Get this attribute type. |
abstract void |
pickle(java.io.DataOutputStream out,
java.lang.Object obj)
Pickle an attribute of this type to the given stream. |
java.lang.String |
stringify(java.lang.Object value)
Stringify a value of this kind. |
abstract java.lang.Object |
unpickle(java.io.DataInputStream in)
Unpickle an attribute of this type from the given stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int COMPUTED
public static final int EDITABLE
public static final int MANDATORY
public static final int DONTSAVE
protected java.lang.String name
protected java.lang.String type
protected int flags
Constructor Detail |
---|
public Attribute(java.lang.String name, java.lang.Object def, java.lang.Integer flags)
name
- The name of the attribute.type
- Its type (as a Java class).def
- Its default value.flags
- Its associated flags.Method Detail |
---|
public java.lang.String getName()
public java.lang.String getType()
public boolean checkFlag(int tst)
public java.lang.Object getDefault()
public java.lang.String stringify(java.lang.Object value)
obj
- The value to stringify.public abstract boolean checkValue(java.lang.Object value)
value
- The value to check.store
- The array to store the value to if succeed.idx
- The location in the above array.
IllegalAttributeAccess
- If the provided value doesn't match
the expected type.public abstract int getPickleLength(java.lang.Object value)
In an ASCII format, this plays a role similar to emitting a newline.
value
- The value that is about to be pickled.
public abstract void pickle(java.io.DataOutputStream out, java.lang.Object obj) throws java.io.IOException
out
- The DataOutputStream to dump the object to.obj
- The object to pickle.
java.io.IOException
- If some IO error occured while dump the
attribute.public abstract java.lang.Object unpickle(java.io.DataInputStream in) throws java.io.IOException
in
- The DataInputStream to read from.
java.io.IOException
- If some IOError occured while reading the stream.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |