All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.tools.store.ObjectAttribute

java.lang.Object
   |
   +----w3c.tools.store.Attribute
           |
           +----w3c.tools.store.ObjectAttribute

public class ObjectAttribute
extends Attribute
A generic Object attribute. This attribute is usefull for attributes that are:


Variable Index

 o cls
The class for values of this attribute.

Constructor Index

 o ObjectAttribute(String, Class, Object, int)
Create a new ObjectAttribute instance.
 o ObjectAttribute(String, String, Object, int)
Create a new ObjectAttribute instance.

Method Index

 o checkValue(Object)
Check that a value is allowed for this attribute.
 o getPickleLength(Object)
Get the number of bytes required to save that attribute value.
 o pickle(DataOutputStream, Object)
The ObjectAttribute values can't be pickled.
 o unpickle(DataInputStream)
The ObjectAttribute values can't be unpickled.

Variables

 o cls
 protected Class cls
The class for values of this attribute.

Constructors

 o ObjectAttribute
 public ObjectAttribute(String name,
                        Class cls,
                        Object def,
                        int flags)
Create a new ObjectAttribute instance.

Parameters:
name - The name of the attribute.
cls - The class for this attribute values.
def - The default value for this attribute.
flags - The attribute flags.
 o ObjectAttribute
 public ObjectAttribute(String name,
                        String cname,
                        Object def,
                        int flags)
Create a new ObjectAttribute instance.

Parameters:
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.
Throws: RuntimeException
If we couldn't resolve the class name.

Methods

 o checkValue
 public boolean checkValue(Object value)
Check that a value is allowed for this attribute.

Parameters:
value - The value to check.
Returns:
A boolean true if value is allowed.
Overrides:
checkValue in class Attribute
 o getPickleLength
 public final int getPickleLength(Object value)
Get the number of bytes required to save that attribute value.

Parameters:
The - value about to be pickled.
Returns:
The number of bytes needed to pickle that value.
Throws: Always
throw a RuntimeException since ObjectAttribute can't be pickled.
Overrides:
getPickleLength in class Attribute
 o pickle
 public void pickle(DataOutputStream out,
                    Object obj)
The ObjectAttribute values can't be pickled.

Overrides:
pickle in class Attribute
 o unpickle
 public Object unpickle(DataInputStream in)
The ObjectAttribute values can't be unpickled.

Overrides:
unpickle in class Attribute

All Packages  Class Hierarchy  This Package  Previous  Next  Index