    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class org.w3c.tools.resources.ObjectAttribute

    java.lang.Object
       |
       +----org.w3c.tools.resources.Attribute
               |
               +----org.w3c.tools.resources.ObjectAttribute

public class ObjectAttribute
extends Attribute

A generic Object attribute. This attribute is usefull for attributes that are:

- Have Object values.
- Need not be saved (have the DONTSAVE bit set).

##

cls
  The class for values of this attribute.

##

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

##

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

##

cls

     protected Class cls

  The class for values of this attribute.

##

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.

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.

##

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

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

pickle

     public void pickle(DataOutputStream out,
                        Object obj)

  The ObjectAttribute values can't be pickled.

  Overrides:
    pickle in class Attribute

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