com.arsdigita.persistence.metadata
Class Property

java.lang.Object
  extended bycom.arsdigita.persistence.metadata.Element
      extended bycom.arsdigita.persistence.metadata.Property

public class Property
extends Element

The Property class represents one property of a CompoundType. Each property is a "field" in the CompoundType. Every Property has an associated DataType. This allows CompoundTypes to be constructed from multiple SimpleTypes and CompoundTypes. In addition to having an associated DataType, each property has an associated multiplicity. There are currently three possible values for the multiplicity of a Property, NULLABLE, REQUIRED, and COLLECTION.

Version:
$Revision: #16 $ $Date: 2004/04/07 $
Author:
rhs@mit.edu

Field Summary
static int COLLECTION
          The COLLECTION multiplicity is for multi valued properties.
static int NULLABLE
          The NULLABLE multiplicity is for single valued properties that can be set to null.
static int REQUIRED
          The REQUIRED multiplicity is for single valued properties that cannot be set to null.
static String versionId
           
 
Method Summary
 Property getAssociatedProperty()
          Returns the associated property or null if there is no associated property.
 Association getAssociation()
          Returns the associon that this property plays a role in, or null if this property doesn't play a role in an association.
 CompoundType getContainer()
          Returns the container of this property.
 Class getJavaClass()
          Returns the java class for the object that will be returned when DataObject.get() is called on this Property.
 CompoundType getLinkType()
          Returns the type of the link object used by this association, or null if there is none.
 int getMultiplicity()
          Returns the integer type code for the multiplicity of this property.
 String getName()
          Returns the name of this Property.
 DataType getType()
          Returns the type of this Property.
 boolean isAttribute()
          Returns true if this Property is an attribute, i.e.
 boolean isCollection()
          Returns true if the multiplicity of this Property is COLLECTION.
 boolean isComponent()
          Returns true if this property is a component.
 boolean isComposite()
          Returns true if this property refers to the composite of the object type containing this property.
 boolean isKeyProperty()
           
 boolean isNullable()
          Returns true if the multiplicity of this Property is NULLABLE.
 boolean isRequired()
          Returns true if the multiplicity of this Property is REQUIRED.
 boolean isRole()
          Returns true if this Property is a role, i.e.
 String toString()
           
 
Methods inherited from class com.arsdigita.persistence.metadata.Element
equals, getColumnNumber, getFilename, getLineNumber, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NULLABLE

public static final int NULLABLE
The NULLABLE multiplicity is for single valued properties that can be set to null.

See Also:
Constant Field Values

REQUIRED

public static final int REQUIRED
The REQUIRED multiplicity is for single valued properties that cannot be set to null.

See Also:
Constant Field Values

COLLECTION

public static final int COLLECTION
The COLLECTION multiplicity is for multi valued properties.

See Also:
Constant Field Values

versionId

public static final String versionId
See Also:
Constant Field Values
Method Detail

getContainer

public CompoundType getContainer()
Returns the container of this property.


getName

public String getName()
Returns the name of this Property.

Returns:
The name of this Property.

getType

public DataType getType()
Returns the type of this Property.

Returns:
The type of this Property.

isAttribute

public boolean isAttribute()
Returns true if this Property is an attribute, i.e. its DataType is simple.

Returns:
True if this Property is an attribute, false otherwise.

isRole

public boolean isRole()
Returns true if this Property is a role, i.e. it's DataType is compound.

Returns:
True if this Property is a role, false otherwise.

getMultiplicity

public int getMultiplicity()
Returns the integer type code for the multiplicity of this property.

Returns:
An integer that is always one of the type codes defined in this class.

isCollection

public boolean isCollection()
Returns true if the multiplicity of this Property is COLLECTION.

Returns:
True if the property is a COLLECTION.

isNullable

public boolean isNullable()
Returns true if the multiplicity of this Property is NULLABLE.

Returns:
True if the multiplicity of this Property is NULLABLE.

isRequired

public boolean isRequired()
Returns true if the multiplicity of this Property is REQUIRED.

Returns:
True if the multiplicity of this Property is REQUIRED.

isComponent

public boolean isComponent()
Returns true if this property is a component.

Returns:
true if this property is a component.

getAssociation

public Association getAssociation()
Returns the associon that this property plays a role in, or null if this property doesn't play a role in an association.

Returns:
An association in which this property is a role, or null.

getLinkType

public CompoundType getLinkType()
Returns the type of the link object used by this association, or null if there is none.

Returns:
The type of the link object used by this association, or null.

getAssociatedProperty

public Property getAssociatedProperty()
Returns the associated property or null if there is no associated property.


isComposite

public boolean isComposite()
Returns true if this property refers to the composite of the object type containing this property.


getJavaClass

public Class getJavaClass()
Returns the java class for the object that will be returned when DataObject.get() is called on this Property.

Returns:
A java Class object.

isKeyProperty

public boolean isKeyProperty()

toString

public String toString()


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC