org.archive.crawler.settings
Class Type

java.lang.Object
  extended by javax.management.Attribute
      extended by org.archive.crawler.settings.Type
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ComplexType, ListType, SimpleType

public abstract class Type
extends javax.management.Attribute

Interface implemented by all element types.

Author:
John Erik Halse
See Also:
Serialized Form

Constructor Summary
Type(java.lang.String name, java.lang.Object value)
          Creates a new instance of Type.
 
Method Summary
 void addConstraint(Constraint constraint)
          Add a constraint to this type.
 boolean equals(java.lang.Object o)
          The implementation of equals consider to Types as equal if name and value are equal.
 java.util.List getConstraints()
          Returns a list of constraints for the value of this type.
(package private) abstract  java.lang.Object getDefaultValue()
          The default value for this type
(package private) abstract  java.lang.String getDescription()
          Get the description of this type The description should be suitable for showing in a user interface.
(package private) abstract  java.lang.Object[] getLegalValues()
          Get the legal values for this type.
 java.lang.Class getLegalValueType()
          Get the class values of this Type must be an instance of.
 boolean isExpertSetting()
          Returns true if this Type should only show up in expert mode in UI.
 boolean isOverrideable()
          Is this an 'overrideable' setting.
 boolean isTransient()
          Returns true if this ComplexType should be saved to persistent storage.
 void setExpertSetting(boolean isExpertSetting)
          Set if this Type should only show up in expert mode in UI.
 void setLegalValueType(java.lang.Class legalValueType)
          Set the class values of this Type must be an instance of.
 void setOverrideable(boolean b)
          Set if this Type should be overideable.
 void setTransient(boolean b)
          Set to false if this attribute should not be serialized to persistent storage.
 
Methods inherited from class javax.management.Attribute
getName, getValue, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Type

public Type(java.lang.String name,
            java.lang.Object value)
Creates a new instance of Type.

Parameters:
name -
value -
Method Detail

getDescription

abstract java.lang.String getDescription()
Get the description of this type The description should be suitable for showing in a user interface.

Returns:
this type's description

getDefaultValue

abstract java.lang.Object getDefaultValue()
The default value for this type

Returns:
this type's default value

getLegalValues

abstract java.lang.Object[] getLegalValues()
Get the legal values for this type.

Returns:
the legal values for this type or null if there are no restrictions.

isOverrideable

public boolean isOverrideable()
Is this an 'overrideable' setting. All settings are overrideable by default.

Returns:
True if this is an an overrideable setting.

setOverrideable

public void setOverrideable(boolean b)
Set if this Type should be overideable.

Parameters:
b - true if this Type should be overideable.

isTransient

public boolean isTransient()
Returns true if this ComplexType should be saved to persistent storage.

Returns:
true if this ComplexType should be saved to persistent storage.

setTransient

public void setTransient(boolean b)
Set to false if this attribute should not be serialized to persistent storage.

Parameters:
b - if false this complexType will not be saved to persistent storage.

isExpertSetting

public boolean isExpertSetting()
Returns true if this Type should only show up in expert mode in UI.

Returns:
true if this Type should only show up in expert mode in UI.

setExpertSetting

public void setExpertSetting(boolean isExpertSetting)
Set if this Type should only show up in expert mode in UI.

Parameters:
isExpertSetting - true if this Type should only show up in expert mode in UI.

getConstraints

public java.util.List getConstraints()
Returns a list of constraints for the value of this type.

Returns:
Returns the constraints or null if there aren't any.

addConstraint

public void addConstraint(Constraint constraint)
Add a constraint to this type. Every constraint must be fulfilled for a value of this type to be valid.

Parameters:
constraint - the constraint to add.

getLegalValueType

public java.lang.Class getLegalValueType()
Get the class values of this Type must be an instance of.

Returns:
Returns the legalValueType.

setLegalValueType

public void setLegalValueType(java.lang.Class legalValueType)
Set the class values of this Type must be an instance of.

Parameters:
legalValueType - The legalValueType to set.

equals

public boolean equals(java.lang.Object o)
The implementation of equals consider to Types as equal if name and value are equal. Description is allowed to differ.

Overrides:
equals in class javax.management.Attribute


Copyright © 2003-2011 Internet Archive. All Rights Reserved.