com.amazon.carbonado.info
Interface StorableProperty<S extends Storable>

All Superinterfaces:
Appender, Serializable
All Known Subinterfaces:
JDBCStorableProperty<S>

public interface StorableProperty<S extends Storable>
extends Serializable, Appender

Contains all the metadata describing a property of a specific Storable type.

Author:
Brian S O'Neill, Tobias Holgers
See Also:
StorableIntrospector

Method Summary
 StorablePropertyAdapter getAdapter()
          Returns this property's adapter, or null if none.
 String getAlias(int index)
          Returns a specific alias for this property.
 int getAliasCount()
          Returns the count of aliases for this property.
 String[] getAliases()
          Returns a new array with all the alias names in it.
 String getBeanName()
          Returns the bean name of this property, which is derived from the read and write method names.
 StorablePropertyConstraint getConstraint(int index)
          Returns a specific constraint for this property.
 int getConstraintCount()
          Returns the count of constraints for this property.
 StorablePropertyConstraint[] getConstraints()
          Returns a new array with all the constraints in it.
 Class<?>[] getCovariantTypes()
          Returns additional types of this property, all of which are assignable by the primary type.
 ChainedProperty<S>[] getDerivedFromProperties()
          Returns a new array with all the derived-from properties, which is empty if this is not a derived property.
 ChainedProperty<?>[] getDerivedToProperties()
          Returns a new array with all the properties which are derived from this one.
 Class<S> getEnclosingType()
          Returns the enclosing type of this property.
 StorableProperty<?> getExternalJoinElement(int index)
          Returns a specific property in the joined class that participates in the join.
 StorableProperty<?>[] getExternalJoinElements()
          Returns a new array with all the external join elements in it.
 StorableProperty<S> getInternalJoinElement(int index)
          Returns a specific property in this property's class that participates in the join.
 StorableProperty<S>[] getInternalJoinElements()
          Returns a new array with all the internal join elements in it.
 Class<? extends Storable> getJoinedType()
          Returns the type of property this is joined to, or null if not joined.
 int getJoinElementCount()
          Returns the count of properties that participate in this property's join.
 String getName()
          Returns the name of this property, which is the same as the bean name unless it has been renamed.
 int getNumber()
          Returns the zero-based numerical position of this property within its enclosing type.
 Method getReadMethod()
          Returns a no-arg method used to read the property value, or null if reading is not allowed.
 String getReadMethodName()
          Returns the name of the read method, even if no read method was actually declared.
 String getSequenceName()
          Returns the property's sequence name, or null if none.
 Class<?> getType()
          Returns the primary type of this property.
 Method getWriteMethod()
          Returns a one argument method used to write the property value, or null if writing is not allowed.
 String getWriteMethodName()
          Returns the name of the write method, even if no write method was actually declared.
 boolean isAlternateKeyMember()
          Returns true if this property is a member of an alternate key.
 boolean isAutomatic()
          Returns true of this property is given an automatic value upon insert.
 boolean isDerived()
          Returns true if this property is derived.
 boolean isIndependent()
          Returns true if this property has been designated independent.
 boolean isJoin()
          Returns true if this property is joined in any way to another Storable.
 boolean isNullable()
          Returns true if this property can be null.
 boolean isOneToOneJoin()
          Returns true if this property is one-to-one joined to another Storable.
 boolean isPrimaryKeyMember()
          Returns true if this property is a member of a primary key.
 boolean isQuery()
          Returns true if this property is a query, which also implies that it is a join property.
 boolean isVersion()
          Returns true if this property is the designated version number for the Storable.
 boolean shouldCopyDerived()
          Returns true if this derived property should be included when copying a storable.
 String toString()
           
 
Methods inherited from interface com.amazon.carbonado.util.Appender
appendTo
 

Method Detail

getName

String getName()
Returns the name of this property, which is the same as the bean name unless it has been renamed.


getBeanName

String getBeanName()
Returns the bean name of this property, which is derived from the read and write method names.

Since:
1.2

getType

Class<?> getType()
Returns the primary type of this property.


getCovariantTypes

Class<?>[] getCovariantTypes()
Returns additional types of this property, all of which are assignable by the primary type.

Since:
1.2.1

getNumber

int getNumber()
Returns the zero-based numerical position of this property within its enclosing type.

Since:
1.2

getEnclosingType

Class<S> getEnclosingType()
Returns the enclosing type of this property.


getReadMethod

Method getReadMethod()
Returns a no-arg method used to read the property value, or null if reading is not allowed. The return type matches the type of this property.


getReadMethodName

String getReadMethodName()
Returns the name of the read method, even if no read method was actually declared. That is, this method always returns a method name, but getReadMethod may still return null.


getWriteMethod

Method getWriteMethod()
Returns a one argument method used to write the property value, or null if writing is not allowed. The first argument is the value to set, which is the type of this property.


getWriteMethodName

String getWriteMethodName()
Returns the name of the write method, even if no write method was actually declared. That is, this method always returns a method name, but getWriteMethod may still return null.


isNullable

boolean isNullable()
Returns true if this property can be null.

See Also:
Nullable

isPrimaryKeyMember

boolean isPrimaryKeyMember()
Returns true if this property is a member of a primary key.

See Also:
PrimaryKey

isAlternateKeyMember

boolean isAlternateKeyMember()
Returns true if this property is a member of an alternate key.

See Also:
AlternateKeys

getAliasCount

int getAliasCount()
Returns the count of aliases for this property.

See Also:
Alias

getAlias

String getAlias(int index)
                throws IndexOutOfBoundsException
Returns a specific alias for this property.

Throws:
IndexOutOfBoundsException
See Also:
Alias

getAliases

String[] getAliases()
Returns a new array with all the alias names in it.

See Also:
Alias

isJoin

boolean isJoin()
Returns true if this property is joined in any way to another Storable.

See Also:
Join

isOneToOneJoin

boolean isOneToOneJoin()
Returns true if this property is one-to-one joined to another Storable.

Since:
1.2
See Also:
Join

getJoinedType

Class<? extends Storable> getJoinedType()
Returns the type of property this is joined to, or null if not joined.


getJoinElementCount

int getJoinElementCount()
Returns the count of properties that participate in this property's join. If this property is not a join, then zero is returned.


getInternalJoinElement

StorableProperty<S> getInternalJoinElement(int index)
                                                            throws IndexOutOfBoundsException
Returns a specific property in this property's class that participates in the join.

Throws:
IndexOutOfBoundsException

getInternalJoinElements

StorableProperty<S>[] getInternalJoinElements()
Returns a new array with all the internal join elements in it.


getExternalJoinElement

StorableProperty<?> getExternalJoinElement(int index)
                                           throws IndexOutOfBoundsException
Returns a specific property in the joined class that participates in the join.

Throws:
IndexOutOfBoundsException

getExternalJoinElements

StorableProperty<?>[] getExternalJoinElements()
Returns a new array with all the external join elements in it.


isQuery

boolean isQuery()
Returns true if this property is a query, which also implies that it is a join property.

See Also:
Query

getConstraintCount

int getConstraintCount()
Returns the count of constraints for this property.


getConstraint

StorablePropertyConstraint getConstraint(int index)
                                         throws IndexOutOfBoundsException
Returns a specific constraint for this property.

Throws:
IndexOutOfBoundsException

getConstraints

StorablePropertyConstraint[] getConstraints()
Returns a new array with all the constraints in it.


getAdapter

StorablePropertyAdapter getAdapter()
Returns this property's adapter, or null if none.


getSequenceName

String getSequenceName()
Returns the property's sequence name, or null if none.

See Also:
Sequence

isAutomatic

boolean isAutomatic()
Returns true of this property is given an automatic value upon insert.

Since:
1.2
See Also:
Automatic

isVersion

boolean isVersion()
Returns true if this property is the designated version number for the Storable.

See Also:
Version

isIndependent

boolean isIndependent()
Returns true if this property has been designated independent.

See Also:
Independent

isDerived

boolean isDerived()
Returns true if this property is derived.

Since:
1.2
See Also:
Derived

getDerivedFromProperties

ChainedProperty<S>[] getDerivedFromProperties()
Returns a new array with all the derived-from properties, which is empty if this is not a derived property. Otherwise, the set is the transitive closure of all dependent properties. This set may include joins and other derived properties.

Since:
1.2

getDerivedToProperties

ChainedProperty<?>[] getDerivedToProperties()
Returns a new array with all the properties which are derived from this one. The set is the transitive closure of all derived properties which depend on this one.

Each property in the set is represented as a chain, where the prime property is the actual dependent property, and the tail is the path to reach this property's enclosing type. If a derived property resides in the same enclosing type as this one, the chain count is zero.

Since:
1.2

shouldCopyDerived

boolean shouldCopyDerived()
Returns true if this derived property should be included when copying a storable. Copying of a derived property uses the "get" and "set" methods and requires the "set" method to be defined.

Since:
1.2

toString

String toString()
Overrides:
toString in class Object


Copyright © 2006-2009 Amazon Technologies, Inc.. All Rights Reserved.