org.archive.crawler.settings
Class SimpleType

java.lang.Object
  extended by javax.management.Attribute
      extended by org.archive.crawler.settings.Type
          extended by org.archive.crawler.settings.SimpleType
All Implemented Interfaces:
java.io.Serializable

public class SimpleType
extends Type

A type that holds a Java type.

Author:
John Erik Halse
See Also:
Serialized Form

Constructor Summary
SimpleType(java.lang.String name, java.lang.String description, java.lang.Object defaultValue)
          Create a new instance of SimpleType.
SimpleType(java.lang.String name, java.lang.String description, java.lang.Object defaultValue, java.lang.Object[] legalValues)
          Create a new instance of SimpleType.
 
Method Summary
 java.lang.Object getDefaultValue()
          The default value for this type
 java.lang.String getDescription()
          Get the description of this type The description should be suitable for showing in a user interface.
 java.lang.Object[] getLegalValues()
          Get the array of legal values for this Type.
 void setLegalValues(java.lang.Object[] legalValues)
          Set the array of legal values for this type.
 
Methods inherited from class org.archive.crawler.settings.Type
addConstraint, equals, getConstraints, getLegalValueType, isExpertSetting, isOverrideable, isTransient, setExpertSetting, setLegalValueType, setOverrideable, setTransient
 
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

SimpleType

public SimpleType(java.lang.String name,
                  java.lang.String description,
                  java.lang.Object defaultValue)
Create a new instance of SimpleType.

Parameters:
name - the name of the type.
description - a description suitable for the UI.
defaultValue - the default value for this type. This also set what kind of Java type that this Type can hold.

SimpleType

public SimpleType(java.lang.String name,
                  java.lang.String description,
                  java.lang.Object defaultValue,
                  java.lang.Object[] legalValues)
Create a new instance of SimpleType.

Parameters:
name - the name of the type.
description - a description suitable for the UI.
defaultValue - the default value for this type. This also set what kind of Java type that this Type can hold.
legalValues - an array of legal values for this simple type. The objects in this array must be of the same type as the default value.
Method Detail

getDescription

public java.lang.String getDescription()
Description copied from class: Type
Get the description of this type The description should be suitable for showing in a user interface.

Specified by:
getDescription in class Type
Returns:
this type's description

getDefaultValue

public java.lang.Object getDefaultValue()
Description copied from class: Type
The default value for this type

Specified by:
getDefaultValue in class Type
Returns:
this type's default value

getLegalValues

public java.lang.Object[] getLegalValues()
Get the array of legal values for this Type.

Specified by:
getLegalValues in class Type
Returns:
the legal values for this type or null if there are no restrictions.

setLegalValues

public void setLegalValues(java.lang.Object[] legalValues)
Set the array of legal values for this type.

The objects in this array must be of the same type as the default value.

Parameters:
legalValues -


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