org.dishevelled.codegen
Class Attribute

java.lang.Object
  extended by org.dishevelled.codegen.Attribute

public final class Attribute
extends Object

An attribute on a class or interface description. An attribute has a role, a cardinality, and if the cardinality is Cardinality.ZeroToMany or Cardinality.OneToMany, a collection description.

Version:
$Revision: 972 $ $Date: 2011-01-04 21:34:39 -0600 (Tue, 04 Jan 2011) $
Author:
Michael Heuer

Constructor Summary
Attribute(String name, String roleName, Cardinality cardinality)
          Create a new attribute with the specified name, role name, and cardinality.
Attribute(String name, String roleName, Cardinality cardinality, boolean bound)
          Create a new attribute with the specified name, role name, cardinality, and bound flag.
Attribute(String name, String roleName, Cardinality cardinality, boolean indexed, boolean unique, boolean ordered, boolean sorted)
          Create a new attribute with the specified name, role name, and cardinality and choose a collection description that satisfies the specified boolean parameters.
Attribute(String name, String roleName, Cardinality cardinality, boolean bound, boolean indexed, boolean unique, boolean ordered, boolean sorted)
          Create a new attribute with the specified name, role name, cardinality, and bound flag and choose a collection description that satisfies the specified boolean parameters.
Attribute(String lower, String mixed, String upper, String description, Role role, Cardinality cardinality, CollectionDescription collectionDescription)
          Create a new attribute from the specified parameters.
Attribute(String lower, String mixed, String upper, String description, Role role, Cardinality cardinality, CollectionDescription collectionDescription, boolean bound)
          Create a new attribute from the specified parameters.
 
Method Summary
 Cardinality getCardinality()
          Return the cardinality for this attribute.
 CollectionDescription getCollectionDescription()
          Return the collection description for this attribute.
 String getDescription()
          Return the description for this attribute.
 String getLower()
          Return the lowercase name for this attribute.
 String getMixed()
          Return the mixed-case name for this attribute.
 Role getRole()
          Return the role for this attribute.
 String getUpper()
          Return the uppercase name for this attribute.
 boolean isBound()
          Return true if this is a "bound" attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Attribute

public Attribute(String name,
                 String roleName,
                 Cardinality cardinality)
Create a new attribute with the specified name, role name, and cardinality. The cardinality must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne.

Parameters:
name - attribute name
roleName - role name
cardinality - cardinality, must not be null and must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne

Attribute

public Attribute(String name,
                 String roleName,
                 Cardinality cardinality,
                 boolean bound)
Create a new attribute with the specified name, role name, cardinality, and bound flag. The cardinality must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne.

Parameters:
name - attribute name
roleName - role name
cardinality - cardinality, must not be null and must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne
bound - true if this is a "bound" attribute

Attribute

public Attribute(String name,
                 String roleName,
                 Cardinality cardinality,
                 boolean indexed,
                 boolean unique,
                 boolean ordered,
                 boolean sorted)
Create a new attribute with the specified name, role name, and cardinality and choose a collection description that satisfies the specified boolean parameters.

Parameters:
name - attribute name
roleName - role name
cardinality - cardinality, must not be null
indexed - true if the collection should be indexed
unique - true if the collection should not allow duplicate elements
ordered - true if the collection should iterate over elements in insertion-order
sorted - true if the collection should iterate over elements in ascending element order, sorted according to the natural ordering of its elements (see Comparable), or by a Comparator provided at creation time

Attribute

public Attribute(String name,
                 String roleName,
                 Cardinality cardinality,
                 boolean bound,
                 boolean indexed,
                 boolean unique,
                 boolean ordered,
                 boolean sorted)
Create a new attribute with the specified name, role name, cardinality, and bound flag and choose a collection description that satisfies the specified boolean parameters.

Parameters:
name - attribute name
roleName - role name
cardinality - cardinality, must not be null
bound - true if this is a "bound" attribute
indexed - true if the collection should be indexed
unique - true if the collection should not allow duplicate elements
ordered - true if the collection should iterate over elements in insertion-order
sorted - true if the collection should iterate over elements in ascending element order, sorted according to the natural ordering of its elements (see Comparable), or by a Comparator provided at creation time

Attribute

public Attribute(String lower,
                 String mixed,
                 String upper,
                 String description,
                 Role role,
                 Cardinality cardinality,
                 CollectionDescription collectionDescription)
Create a new attribute from the specified parameters.

Parameters:
lower - lowercase name for this attribute
mixed - mixed-case name for this attribute
upper - uppercase name for this attribute
description - description for this attribute
role - role for this attribute, must not be null
cardinality - cardinality for this attribute, must not be null
collectionDescription - collection description for this attribute

Attribute

public Attribute(String lower,
                 String mixed,
                 String upper,
                 String description,
                 Role role,
                 Cardinality cardinality,
                 CollectionDescription collectionDescription,
                 boolean bound)
Create a new attribute from the specified parameters.

Parameters:
lower - lowercase name for this attribute
mixed - mixed-case name for this attribute
upper - uppercase name for this attribute
description - description for this attribute
role - role for this attribute, must not be null
cardinality - cardinality for this attribute, must not be null
collectionDescription - collection description for this attribute
bound - true if this is a "bound" attribute
Method Detail

getLower

public String getLower()
Return the lowercase name for this attribute.

Returns:
the lowercase name for this attribute

getMixed

public String getMixed()
Return the mixed-case name for this attribute.

Returns:
the mixed-case name for this attribute

getUpper

public String getUpper()
Return the uppercase name for this attribute.

Returns:
the uppercase name for this attribute

getDescription

public String getDescription()
Return the description for this attribute.

Returns:
the description for this attribute

getRole

public Role getRole()
Return the role for this attribute. The role will not be null.

Returns:
the role for this attribute

getCardinality

public Cardinality getCardinality()
Return the cardinality for this attribute. The cardinality will not be null.

Returns:
the cardinality for this attribute

getCollectionDescription

public CollectionDescription getCollectionDescription()
Return the collection description for this attribute. The collection description may be null.

Returns:
the collection description for this attribute

isBound

public boolean isBound()
Return true if this is a "bound" attribute.

Returns:
true if this is a "bound" attribute


Copyright (c) 2004-2011 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).