org.ujac.print
Class AttributeDefinition

java.lang.Object
  extended by org.ujac.print.AttributeDefinition

public class AttributeDefinition
extends Object

Name: AttributeDefinition
Description: A class for attribute definitions.

Author:
lauerc

Field Summary
static int TYPE_BOOLEAN
          Constant for boolean attribute type.
static int TYPE_BORDER
          Constant for border attribute type.
static int TYPE_COLOR
          Constant for color attribute type.
static int TYPE_DIMENSION
          Constant for float attribute type.
static int TYPE_ENUM
          Constant for enumeration attribute type.
static int TYPE_FLOAT
          Constant for float attribute type.
static int TYPE_FONT_FAMILY
          Constant for font family attribute type.
static int TYPE_FONT_STYLE
          Constant for font style attribute type.
static int TYPE_HORIZONTAL_ALIGNMENT
          Constant for horizontal alignment attribute type.
static int TYPE_INT
          Constant for integer attribute type.
static int TYPE_NAME
          Constant for name attribute type.
static int TYPE_PAGE_SIZE
          Constant for page size attribute type.
static int TYPE_STRING
          Constant for string attribute type.
static int TYPE_VERTICAL_ALIGNMENT
          Constant for vertical alignment attribute type.
 
Constructor Summary
AttributeDefinition(String name, int type, boolean required, String description)
          Constructs a AttributeDefinition instance with specific arguments.
AttributeDefinition(String name, int type, boolean required, String description, String deprecation)
          Constructs a AttributeDefinition instance with specific arguments.
AttributeDefinition(String name, int type, boolean required, String description, String[] aliases)
          Constructs a AttributeDefinition instance with specific arguments.
AttributeDefinition(String name, String[] possibleValues, boolean required, String description)
          Constructs a AttributeDefinition instance with specific arguments.
AttributeDefinition(String name, String[] possibleValues, boolean required, String description, String deprecation)
          Constructs a AttributeDefinition instance with specific arguments.
 
Method Summary
 AttributeDefinition addAlias(String alias)
          Adds the given alias to the alias set.
 AttributeDefinition addAliases(String[] aliases)
          Adds the given aliases to the alias set.
 boolean checkAlias(String alias)
          Checks whether or not the given name is a registered alias.
 AttributeDefinition cloneAttrDef()
          Creates a clone from the current instance.
 AttributeDefinition cloneAttrDef(String description)
          Creates a clone from the current instance.
 Collection getAliases()
          Gets an iterator for the alias set.
 String getDeprecation()
          Getter method for the the property deprecation.
 String getDescription()
          Gets the attribute's description.
 String getName()
          Gets the attribute's name.
 String[] getPossibleValues()
          Gets the list of possible values for the attribute.
 int getType()
          Gets the attribute's type.
 boolean isRequired()
          Gets the attribute's required flag.
 AttributeDefinition setDeprecation(String deprecation)
          Setter method for the the property deprecation.
 AttributeDefinition setRequired(boolean required)
          Sets the attribute's required flag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_INT

public static final int TYPE_INT
Constant for integer attribute type.

See Also:
Constant Field Values

TYPE_FLOAT

public static final int TYPE_FLOAT
Constant for float attribute type.

See Also:
Constant Field Values

TYPE_BOOLEAN

public static final int TYPE_BOOLEAN
Constant for boolean attribute type.

See Also:
Constant Field Values

TYPE_STRING

public static final int TYPE_STRING
Constant for string attribute type.

See Also:
Constant Field Values

TYPE_COLOR

public static final int TYPE_COLOR
Constant for color attribute type.

See Also:
Constant Field Values

TYPE_BORDER

public static final int TYPE_BORDER
Constant for border attribute type.

See Also:
Constant Field Values

TYPE_HORIZONTAL_ALIGNMENT

public static final int TYPE_HORIZONTAL_ALIGNMENT
Constant for horizontal alignment attribute type.

See Also:
Constant Field Values

TYPE_VERTICAL_ALIGNMENT

public static final int TYPE_VERTICAL_ALIGNMENT
Constant for vertical alignment attribute type.

See Also:
Constant Field Values

TYPE_PAGE_SIZE

public static final int TYPE_PAGE_SIZE
Constant for page size attribute type.

See Also:
Constant Field Values

TYPE_FONT_FAMILY

public static final int TYPE_FONT_FAMILY
Constant for font family attribute type.

See Also:
Constant Field Values

TYPE_FONT_STYLE

public static final int TYPE_FONT_STYLE
Constant for font style attribute type.

See Also:
Constant Field Values

TYPE_NAME

public static final int TYPE_NAME
Constant for name attribute type.

See Also:
Constant Field Values

TYPE_ENUM

public static final int TYPE_ENUM
Constant for enumeration attribute type.

See Also:
Constant Field Values

TYPE_DIMENSION

public static final int TYPE_DIMENSION
Constant for float attribute type.

See Also:
Constant Field Values
Constructor Detail

AttributeDefinition

public AttributeDefinition(String name,
                           int type,
                           boolean required,
                           String description)
Constructs a AttributeDefinition instance with specific arguments.

Parameters:
name - The attribute name.
type - The attribute type
required - The required flag.
description - The attribute description.

AttributeDefinition

public AttributeDefinition(String name,
                           int type,
                           boolean required,
                           String description,
                           String[] aliases)
Constructs a AttributeDefinition instance with specific arguments.

Parameters:
name - The attribute name.
type - The attribute type
required - The required flag.
description - The attribute description.
aliases - The aliases to support.

AttributeDefinition

public AttributeDefinition(String name,
                           int type,
                           boolean required,
                           String description,
                           String deprecation)
Constructs a AttributeDefinition instance with specific arguments.

Parameters:
name - The attribute name.
type - The attribute type
required - The required flag.
description - The attribute description.
deprecation - The deprecation message.

AttributeDefinition

public AttributeDefinition(String name,
                           String[] possibleValues,
                           boolean required,
                           String description)
Constructs a AttributeDefinition instance with specific arguments.

Parameters:
name - The attribute name.
possibleValues - The enumeration values.
required - The required flag.
description - The attribute description.

AttributeDefinition

public AttributeDefinition(String name,
                           String[] possibleValues,
                           boolean required,
                           String description,
                           String deprecation)
Constructs a AttributeDefinition instance with specific arguments.

Parameters:
name - The attribute name.
possibleValues - The enumeration values.
required - The required flag.
description - The attribute description.
deprecation - The deprecation message.
Method Detail

getName

public String getName()
Gets the attribute's name.

Returns:
The attribute name.

getType

public int getType()
Gets the attribute's type.

Returns:
The attribute type.

isRequired

public boolean isRequired()
Gets the attribute's required flag.

Returns:
true, if the attribute is required, else false.

setRequired

public AttributeDefinition setRequired(boolean required)
Sets the attribute's required flag.

Parameters:
required - true, if the attribute is required, else false.
Returns:
The instance itself.

getDescription

public String getDescription()
Gets the attribute's description.

Returns:
The attribute's description.

setDeprecation

public AttributeDefinition setDeprecation(String deprecation)
Setter method for the the property deprecation.

Parameters:
deprecation - The value to set for the property deprecation.
Returns:
The instance itself.

getDeprecation

public String getDeprecation()
Getter method for the the property deprecation.

Returns:
The current value of property deprecation.

getPossibleValues

public String[] getPossibleValues()
Gets the list of possible values for the attribute.

Returns:
The list of possible values.

addAliases

public AttributeDefinition addAliases(String[] aliases)
Adds the given aliases to the alias set.

Parameters:
aliases - The aliases to add.
Returns:
A reference to this instance.

addAlias

public AttributeDefinition addAlias(String alias)
Adds the given alias to the alias set.

Parameters:
alias - The alias to add.
Returns:
A reference to this instance.

checkAlias

public boolean checkAlias(String alias)
Checks whether or not the given name is a registered alias.

Parameters:
alias - The alias to check.
Returns:
true if the given name is a registered alias, else false.

getAliases

public Collection getAliases()
Gets an iterator for the alias set.

Returns:
An iterator for the alias set.

cloneAttrDef

public AttributeDefinition cloneAttrDef()
Creates a clone from the current instance.

Returns:
The cloned instance.

cloneAttrDef

public AttributeDefinition cloneAttrDef(String description)
Creates a clone from the current instance.

Parameters:
description - The description to set for the clone.
Returns:
The cloned instance.


Copyright © 2003-2004 UJAC.org. All Rights Reserved.