org.dishevelled.codegen
Class InterfaceDescription

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

public final class InterfaceDescription
extends Object

A description of the attributes and associations for an interface.

Version:
$Revision: 1059 $ $Date: 2012-01-03 14:03:02 -0600 (Tue, 03 Jan 2012) $
Author:
Michael Heuer

Constructor Summary
InterfaceDescription(String packageName, String name)
          Create a new interface description with the specified package name and name.
InterfaceDescription(String license, String packageName, String name)
          Create a new interface description with the specified package name and name.
InterfaceDescription(String packageName, String name, String author, String version, String description)
          Create a new interface description from the specified parameters.
InterfaceDescription(String packageName, String lower, String mixed, String upper, String author, String version, String description)
          Create a new interface description from the specified parameters.
InterfaceDescription(String packageName, String lower, String mixed, String upper, String author, String version, String description, Set<InterfaceDescription> specializes, Set<Attribute> attributes, Set<Association> associations)
          Create a new interface description from the specified parameters.
 
Method Summary
 boolean addAssociation(Association association)
          Add the specified association to the set of associations for this interface description.
 boolean addAttribute(Attribute attribute)
          Add the specified attribute to the set of attributes for this interface description.
 boolean addSpecializes(InterfaceDescription specializes)
          Add the specified interface description to the set of interfaces this interface description specializes.
 boolean associate(Association association)
          Add the specified association to the set of associations for this interface description.
 boolean associate(ClassDescription cd, Cardinality cardinality)
          Add a new association to the set of associations for this interface description to the specified class with the specified cardinality.
 boolean associate(ClassDescription cd, Cardinality cardinality, boolean indexed, boolean unique, boolean ordered, boolean sorted)
          Add a new association to the set of associations for this interface description to the specified class with the specified parameters.
 boolean associate(ClassDescription cd, String roleName, Cardinality cardinality)
          Add a new association to the set of attributes for this interface description to the specified class with the specified role name and cardinality.
 boolean associate(ClassDescription cd, String roleName, Cardinality cardinality, boolean indexed, boolean unique, boolean ordered, boolean sorted)
          Add a new association to the set of associations for this interface description to the specified class with the specified parameters.
 boolean associate(InterfaceDescription id, Cardinality cardinality)
          Add a new association to the set of associations for this interface description to the specified interface with the specified cardinality.
 boolean associate(InterfaceDescription id, Cardinality cardinality, boolean indexed, boolean unique, boolean ordered, boolean sorted)
          Add a new association to the set of associations for this interface description to the specified interface with the specified parameters.
 boolean associate(InterfaceDescription id, String roleName, Cardinality cardinality)
          Add a new association to the set of attributes for this interface description to the specified interface with the specified role name and cardinality.
 boolean associate(InterfaceDescription id, String roleName, Cardinality cardinality, boolean indexed, boolean unique, boolean ordered, boolean sorted)
          Add a new association to the set of associations for this interface description to the specified interface with the specified parameters.
 boolean attribute(Attribute attribute)
          Add the specified attribute to the set of attributes for this interface description.
 boolean attribute(String name, String roleName, Cardinality cardinality)
          Add a new attribute to the set of attributes for this interface description with the specified name, role name, and cardinality.
 boolean attribute(String name, String roleName, Cardinality cardinality, boolean indexed, boolean unique, boolean ordered, boolean sorted)
          Add a new attribute to the set of attributes for this interface description with the specified parameters.
 Set<Association> getAssociations()
          Return an unmodifiable set of associations for this interface description.
 Set<Attribute> getAttributes()
          Return an unmodifiable set of attributes for this interface description.
 String getAuthor()
          Return the author for this interface description.
 String getDescription()
          Return the description for this interface description.
 String getLicense()
          Return the license for this interface description.
 String getLower()
          Return the lowercase name for this interface description.
 String getMixed()
          Return the mixed-case name for this interface description.
 String getPackageName()
          Return the package name for this interface description.
 Set<InterfaceDescription> getSpecializes()
          Return an unmodifiable set of interfaces this interface description specializes.
 String getUpper()
          Return the uppercase name for this interface description.
 String getVersion()
          Return the version for this interface description.
 boolean specializes(InterfaceDescription specializes)
          Add the specified interface description to the set of interfaces this interface description specializes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InterfaceDescription

public InterfaceDescription(String packageName,
                            String name)
Create a new interface description with the specified package name and name.

Parameters:
packageName - package name for this interface description
name - name of this interface description

InterfaceDescription

public InterfaceDescription(String license,
                            String packageName,
                            String name)
Create a new interface description with the specified package name and name.

Parameters:
license - license for this interface description
packageName - package name for this interface description
name - name of this interface description

InterfaceDescription

public InterfaceDescription(String packageName,
                            String name,
                            String author,
                            String version,
                            String description)
Create a new interface description from the specified parameters.

Parameters:
packageName - package name for this interface description
name - uppercase name for this interface description
author - author for this interface description
version - version for this interface description
description - description for this interface description

InterfaceDescription

public InterfaceDescription(String packageName,
                            String lower,
                            String mixed,
                            String upper,
                            String author,
                            String version,
                            String description)
Create a new interface description from the specified parameters.

Parameters:
packageName - package name for this interface description
lower - lowercase name for this interface description
mixed - mixed-case name for this interface description
upper - uppercase name for this interface description
author - author for this interface description
version - version for this interface description
description - description for this interface description

InterfaceDescription

public InterfaceDescription(String packageName,
                            String lower,
                            String mixed,
                            String upper,
                            String author,
                            String version,
                            String description,
                            Set<InterfaceDescription> specializes,
                            Set<Attribute> attributes,
                            Set<Association> associations)
Create a new interface description from the specified parameters.

The interfaces this interface description specializes in specializes are copied defensively into this class.

The attributes in attributes are copied defensively into this class.

The associations in associations are copied defensively into this class.

Parameters:
packageName - package name for this interface description
lower - lowercase name for this interface description
mixed - mixed-case name for this interface description
upper - uppercase name for this interface description
author - author for this interface description
version - version for this interface description
description - description for this interface description
specializes - set of interfaces this interface description specializes, must not be null
attributes - set of attributes, must not be null
associations - set of associations, must not be null
Method Detail

getLicense

public String getLicense()
Return the license for this interface description.

Returns:
the license for this interface description

getPackageName

public String getPackageName()
Return the package name for this interface description.

Returns:
the package name for this interface description

getLower

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

Returns:
the lowercase name for this interface description

getMixed

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

Returns:
the mixed-case name for this interface description

getUpper

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

Returns:
the uppercase name for this interface description

getAuthor

public String getAuthor()
Return the author for this interface description.

Returns:
the author for this interface description

getVersion

public String getVersion()
Return the version for this interface description.

Returns:
the version for this interface description

getDescription

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

Returns:
the description for this interface description

getSpecializes

public Set<InterfaceDescription> getSpecializes()
Return an unmodifiable set of interfaces this interface description specializes.

Returns:
an unmodifiable set of interfaces this interface description specializes

addSpecializes

public boolean addSpecializes(InterfaceDescription specializes)
Add the specified interface description to the set of interfaces this interface description specializes. Return true if the set of interfaces this interface description specializes changed as a result of this call.

Parameters:
specializes - interface description to add, must not be null
Returns:
true if the set of interfaces this interface description specializes changed as a result of this call

specializes

public boolean specializes(InterfaceDescription specializes)
Add the specified interface description to the set of interfaces this interface description specializes. Return true if the set of interfaces this interface description specializes changed as a result of this call.

Parameters:
specializes - interface description to add, must not be null
Returns:
true if the set of interfaces this interface description specializes changed as a result of this call

getAttributes

public Set<Attribute> getAttributes()
Return an unmodifiable set of attributes for this interface description.

Returns:
an unmodifiable set of attributes for this interface description

addAttribute

public boolean addAttribute(Attribute attribute)
Add the specified attribute to the set of attributes for this interface description. Return true if the set of attributes changed as a result of this call.

Parameters:
attribute - attribute to add, must not be null
Returns:
true if the set of attributes changed as a result of this call

attribute

public boolean attribute(Attribute attribute)
Add the specified attribute to the set of attributes for this interface description. Return true if the set of attributes changed as a result of this call.

Parameters:
attribute - attribute to add, must not be null
Returns:
true if the set of attributes changed as a result of this call

attribute

public boolean attribute(String name,
                         String roleName,
                         Cardinality cardinality)
Add a new attribute to the set of attributes for this interface description with the specified name, role name, and cardinality. The cardinality must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne. Return true if the set of attributes changed as a result of this call.

Parameters:
name - attribute name
roleName - role name
cardinality - cardinality, must not be null and must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne
Returns:
true if the set of attributes changed as a result of this call

attribute

public boolean attribute(String name,
                         String roleName,
                         Cardinality cardinality,
                         boolean indexed,
                         boolean unique,
                         boolean ordered,
                         boolean sorted)
Add a new attribute to the set of attributes for this interface description with the specified parameters. Return true if the set of attributes changed as a result of this call.

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
Returns:
true if the set of attributes changed as a result of this call

getAssociations

public Set<Association> getAssociations()
Return an unmodifiable set of associations for this interface description.

Returns:
an unmodifiable set of associations for this interface description

addAssociation

public boolean addAssociation(Association association)
Add the specified association to the set of associations for this interface description. Return true if the set of associations changed as a result of this call.

Parameters:
association - association to add, must not be null
Returns:
true if the set of associations changed as a result of this call

associate

public boolean associate(Association association)
Add the specified association to the set of associations for this interface description. Return true if the set of associations changed as a result of this call.

Parameters:
association - association to add, must not be null
Returns:
true if the set of associations changed as a result of this call

associate

public boolean associate(ClassDescription cd,
                         Cardinality cardinality)
Add a new association to the set of associations for this interface description to the specified class with the specified cardinality. The assocation's role name will be the same as the class' name. The cardinality must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne. Return true if the set of associations changed as a result of this call.

Parameters:
cd - class description, must not be null
cardinality - cardinality, must not be null and must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne
Returns:
true if the set of associations changed as a result of this call

associate

public boolean associate(ClassDescription cd,
                         String roleName,
                         Cardinality cardinality)
Add a new association to the set of attributes for this interface description to the specified class with the specified role name and cardinality. The cardinality must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne. Return true if the set of associations changed as a result of this call.

Parameters:
cd - class description, must not be null
roleName - role name
cardinality - cardinality, must not be null and must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne
Returns:
true if the set of associations changed as a result of this call

associate

public boolean associate(ClassDescription cd,
                         Cardinality cardinality,
                         boolean indexed,
                         boolean unique,
                         boolean ordered,
                         boolean sorted)
Add a new association to the set of associations for this interface description to the specified class with the specified parameters. The association's role name will be the same as the class' name.

Parameters:
cd - class description, must not be null
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
Returns:
true if the set of associations changed as a result of this call

associate

public boolean associate(ClassDescription cd,
                         String roleName,
                         Cardinality cardinality,
                         boolean indexed,
                         boolean unique,
                         boolean ordered,
                         boolean sorted)
Add a new association to the set of associations for this interface description to the specified class with the specified parameters.

Parameters:
cd - class description, must not be null
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
Returns:
true if the set of associations changed as a result of this call

associate

public boolean associate(InterfaceDescription id,
                         Cardinality cardinality)
Add a new association to the set of associations for this interface description to the specified interface with the specified cardinality. The assocation's role name will be the same as the interface's name. The cardinality must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne. Return true if the set of associations changed as a result of this call.

Parameters:
id - interface description, must not be null
cardinality - cardinality, must not be null and must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne
Returns:
true if the set of associations changed as a result of this call

associate

public boolean associate(InterfaceDescription id,
                         String roleName,
                         Cardinality cardinality)
Add a new association to the set of attributes for this interface description to the specified interface with the specified role name and cardinality. The cardinality must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne. Return true if the set of associations changed as a result of this call.

Parameters:
id - interface description, must not be null
roleName - role name
cardinality - cardinality, must not be null and must be one of Cardinality.ZeroToOne or Cardinality.StrictlyOne
Returns:
true if the set of associations changed as a result of this call

associate

public boolean associate(InterfaceDescription id,
                         Cardinality cardinality,
                         boolean indexed,
                         boolean unique,
                         boolean ordered,
                         boolean sorted)
Add a new association to the set of associations for this interface description to the specified interface with the specified parameters. The association's role name will be the same as the interface's name.

Parameters:
id - interface description, must not be null
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
Returns:
true if the set of associations changed as a result of this call

associate

public boolean associate(InterfaceDescription id,
                         String roleName,
                         Cardinality cardinality,
                         boolean indexed,
                         boolean unique,
                         boolean ordered,
                         boolean sorted)
Add a new association to the set of associations for this interface description to the specified interface with the specified parameters.

Parameters:
id - interface description, must not be null
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
Returns:
true if the set of associations changed as a result of this call


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