org.enhydra.zeus.binding
Interface Property

All Superinterfaces:
Binding
All Known Implementing Classes:
BaseProperty, ContainerProperty

public interface Property
extends Binding

Property implements the Binding interface and defines behavior for a property of a Java class. These properties have modifiers, types, and names, as well as a value.

Author:
Brett McLaughlin, Steve Witten, Maciej Zawadzki

Field Summary
static int ACCESS_PRIVATE
          Access Modifier: private
static int ACCESS_PROTECTED
          Access Modifier: private
static int ACCESS_PUBLIC
          Access Modifier: public
static int MUTABILITY_FINAL
          Mutability Modifier: final
static int MUTABILITY_SYNCHRONIZED
          Mutability Modifier: synchronized
static int MUTABILITY_TRANSIENT
          Mutability Modifier: transient
static int MUTABILITY_VOLATILE
          Mutability Modifier: volatile
static int SOURCE_ATTLIST
          The source of the property; in this case, an attribute
static int SOURCE_ELEMENT
          The source of the property; in this case, an element
static int STORAGE_STATIC
          Storage Modifier: static
 
Method Summary
 java.lang.Object getDefaultValue()
           This will retrieve the default value associated with this property, or null if there is not one.
 java.util.Vector getEnumeration()
           This returns the Vector of allowed values for this Property, or null if there is none.
 java.util.BitSet getModifier()
           This will return the modifier for a property.The value returned will be in the form of a BitSet, in which the set bits correspond to the constants defined (ACCESS_PRIVATE, ACCESS_PROTECTED, ACCESS_PUBLIC, STORAGE_STATIC, MUTABILITY_VOLATILE, MUTABILITY_FINAL or MUTABILITY_SYNCHRONIZED).
 java.lang.String getModifierString()
           This will return the Java String representation of this Property's modifier.
 boolean hasDefaultValue()
           This indicates whether or not this Property has a a default value set.
 boolean hasEnumeration()
           This will indicate if this Property has a set of allowed values (an enumeration) specified for it.
 boolean isCollection()
           This will indicate whether this Property represents a Collection of values (resulting in a true result from this method), or a singular value (resulting in a false result).
 void setDefaultValue(java.lang.Object defaultValue)
           This will set the default value of the property.
 void setEnumeration(java.util.Vector enumeration)
           This will set a list (enumeration) of allowed values for this Property.
 void setIsCollection(boolean isCollection)
           This will whether or not this Property is a Collection (in other words, the property represents a collection of values).
 void setModifier(java.util.BitSet modifier)
           This will set the modifier for a property.
 
Methods inherited from interface org.enhydra.zeus.Binding
getJavaCollectionClass, getJavaImplementationPackage, getJavaInterfacePackage, getJavaName, getJavaType, getJavaVariableName, getXMLName, getXMLNamespaceURI, getXMLParentType, getXMLParentTypeNamespaceURI, getXMLType, getXMLTypeNamespaceURI, isJavaSerializable, isXMLRootElement, setIsJavaSerializable, setIsXMLRootElement, setJavaCollectionClass, setJavaImplementationPackage, setJavaInterfacePackage, setJavaName, setJavaType, setJavaVariableName, setXMLName, setXMLNamespaceURI, setXMLParentType, setXMLParentTypeNamespaceURI, setXMLType, setXMLTypeNamespaceURI
 

Field Detail

ACCESS_PRIVATE

public static final int ACCESS_PRIVATE
Access Modifier: private

ACCESS_PROTECTED

public static final int ACCESS_PROTECTED
Access Modifier: private

ACCESS_PUBLIC

public static final int ACCESS_PUBLIC
Access Modifier: public

STORAGE_STATIC

public static final int STORAGE_STATIC
Storage Modifier: static

MUTABILITY_VOLATILE

public static final int MUTABILITY_VOLATILE
Mutability Modifier: volatile

MUTABILITY_FINAL

public static final int MUTABILITY_FINAL
Mutability Modifier: final

MUTABILITY_SYNCHRONIZED

public static final int MUTABILITY_SYNCHRONIZED
Mutability Modifier: synchronized

MUTABILITY_TRANSIENT

public static final int MUTABILITY_TRANSIENT
Mutability Modifier: transient

SOURCE_ATTLIST

public static final int SOURCE_ATTLIST
The source of the property; in this case, an attribute

SOURCE_ELEMENT

public static final int SOURCE_ELEMENT
The source of the property; in this case, an element
Method Detail

setModifier

public void setModifier(java.util.BitSet modifier)

This will set the modifier for a property. The value submitted must be in the form of a BitSet, in which the set bits correspond to the constants defined (ACCESS_PRIVATE, ACCESS_PROTECTED, ACCESS_PUBLIC, STORAGE_STATIC, MUTABILITY_VOLATILE, MUTABILITY_FINAL or MUTABILITY_SYNCHRONIZED). By default, all properties will be private (ACCESS_PRIVATE).

Parameters:
modifier - int constant for access level.
See Also:
ACCESS_PRIVATE, ACCESS_PROTECTED, ACCESS_PUBLIC, STORAGE_STATIC, MUTABILITY_VOLATILE, MUTABILITY_FINAL, MUTABILITY_SYNCHRONIZED

getModifier

public java.util.BitSet getModifier()

This will return the modifier for a property.The value returned will be in the form of a BitSet, in which the set bits correspond to the constants defined (ACCESS_PRIVATE, ACCESS_PROTECTED, ACCESS_PUBLIC, STORAGE_STATIC, MUTABILITY_VOLATILE, MUTABILITY_FINAL or MUTABILITY_SYNCHRONIZED). By default, all properties will be private (ACCESS_PRIVATE).

Returns:
BitSet - the constant(s) for access level.
See Also:
ACCESS_PRIVATE, ACCESS_PROTECTED, ACCESS_PUBLIC, STORAGE_STATIC, MUTABILITY_VOLATILE, MUTABILITY_FINAL, MUTABILITY_SYNCHRONIZED

getModifierString

public java.lang.String getModifierString()

This will return the Java String representation of this Property's modifier. For example, ACCESS_PRIVATE would be converted to "private".

Returns:
String - character constant(s) for access level.
See Also:
ACCESS_PRIVATE, ACCESS_PROTECTED, ACCESS_PUBLIC, STORAGE_STATIC, MUTABILITY_VOLATILE, MUTABILITY_FINAL, MUTABILITY_SYNCHRONIZED

setIsCollection

public void setIsCollection(boolean isCollection)

This will whether or not this Property is a Collection (in other words, the property represents a collection of values). By default, properties are all singular values.

Parameters:
isCollection - true if multiple values can be stored, or else false.

isCollection

public boolean isCollection()

This will indicate whether this Property represents a Collection of values (resulting in a true result from this method), or a singular value (resulting in a false result).

Returns:
boolean - whether or not this Property represents a Collection.

hasDefaultValue

public boolean hasDefaultValue()

This indicates whether or not this Property has a a default value set.

Returns:
boolean - whether there is a default value set.

setDefaultValue

public void setDefaultValue(java.lang.Object defaultValue)

This will set the default value of the property. Since no typing is available at this point, a simple Java Object is allowed as the type supplied. As a result, any errors in mismatches between object type and allowed paramater type will occur at runtime, when class generation takes place. Supplying a value here essentially results in:

    public class Foo {

        private String myString = "some default value";

        public String getMyString() {
            return myString;
        }

        public void setMyString(String myString) {
            this.myString = myString;
        }
 
        // Other methods and properties
    }
 

Also, note that data binding users who supply their own class implementations will LOSE THIS DEFAULT VALUE, as the interface alone cannot specify a default value. So use this carefully!

Parameters:
defaultValue - Object to be used as default value.

getDefaultValue

public java.lang.Object getDefaultValue()

This will retrieve the default value associated with this property, or null if there is not one. For more information on default property values, see setDefaultValue(Object).

Returns:
Object - default value of the property.

hasEnumeration

public boolean hasEnumeration()

This will indicate if this Property has a set of allowed values (an enumeration) specified for it.

Returns:
boolean - whether an enumeration is specified.

setEnumeration

public void setEnumeration(java.util.Vector enumeration)

This will set a list (enumeration) of allowed values for this Property.

Parameters:
enumeration - the Vector of allowed values.

getEnumeration

public java.util.Vector getEnumeration()

This returns the Vector of allowed values for this Property, or null if there is none.

Returns:
Vector - the allowed values.


Copyright © 2002 Enhydra. All Rights Reserved.