org.openptk.api
Interface AttributeIF

All Known Implementing Classes:
Attribute

public interface AttributeIF

Author:
Scott Fehrman, Sun Microsystems, Inc.
contributor: Derrick Harcey, Sun Microsystems, Inc.

Nested Class Summary
static class AttributeIF.Access
           
 
Method Summary
 boolean allowMultivalue()
          Return TRUE if the Attribute allows multivalues.
 AttributeIF copy()
          Returns a copy of the instance.
 AttributeIF.Access getAccess()
          Get the Attributes Access level.
 java.lang.String getAccessAsString()
          Get the String representation of the Attributes Access level.
 java.lang.String getName()
          Get the Attributes name.
 java.util.Properties getProperties()
          Returns the Properties for the Attribute.
 int getPropertiesSize()
          Returns the quantity of Properties.
 java.lang.String getProperty(java.lang.String key)
          Get the Property value from the Attribute.
 State getState()
          Get the Attributes State.
 DataType getType()
          Get the Attributes type.
 java.lang.String getTypeAsString()
          Get the Attributes type, as a String.
 java.lang.Object getValue()
          Get the Attributes value.
 java.lang.String getValueAsString()
          Get the attributes value as a String, regardless of it's internal type.
 boolean isEncrypted()
          Returns TRUE if the value is encrypted.
 boolean isMultivalued()
          Return TRUE if the actual value is contains muliple values.
 boolean isReadOnly()
          Get the Attributes read only flag.
 boolean isRequired()
          Get the Attributes required flag.
 boolean isVirtual()
          Get the Attributes virtual flag.
 void setAccess(AttributeIF.Access access)
          Set the Attributes Access level.
 void setAccess(java.lang.String access)
          Set the Attribute Access level.
 void setAllowMultivalue(boolean value)
          Set the flag to define if the Attribute allows multivalues.
 void setEncrypted(boolean bEncrypted)
          Set the flag to define if the Attribute value is encrypted.
 void setProperties(java.util.Properties props)
          Sets / Replaces the Attributes Properties.
 void setProperty(java.lang.String key, java.lang.String value)
          Add the key / value as a Property to the Attribute.
 void setReadOnly(boolean value)
          Set the Attributes read only flag.
 void setRequired(boolean bool)
          Set the Attributes required flag.
 void setState(State state)
          Set the Attributes State.
 void setType(DataType type)
          Set the Attributes type (enum).
 void setValue(boolean value)
          Set the Attributes value to a single Boolean.
 void setValue(java.lang.Boolean value)
          Set the Attributes value to a single Boolean.
 void setValue(boolean[] value)
          Set the Attributes value to a Boolean array.
 void setValue(java.lang.Boolean[] value)
          Set the Attributes value to a Boolean array.
 void setValue(int value)
          Set the Attributes value to a single Integer.
 void setValue(int[] value)
          Set the Attributes value to a Integer array.
 void setValue(java.lang.Integer value)
          Set the Attributes value to a single Integer.
 void setValue(java.lang.Integer[] value)
          Set the Attributes value to a Integer array.
 void setValue(java.lang.Object value)
          Set the Attributes value to the single Object.
 void setValue(java.lang.Object[] value)
          Set the Attributes value to the Object array.
 void setValue(java.lang.String value)
          Set the Attributes value to a single String.
 void setValue(java.lang.String[] value)
          Set the Attributes value to a String array.
 void setVirtual(boolean bool)
          Set the Attributes virtual flag.
 

Method Detail

allowMultivalue

boolean allowMultivalue()
Return TRUE if the Attribute allows multivalues.

Returns:
boolean are multivalues allowed

copy

AttributeIF copy()
Returns a copy of the instance.

Returns:
AttributeIF copy of the Attribute instance

getAccess

AttributeIF.Access getAccess()
Get the Attributes Access level.

Returns:
Access the Access level

getAccessAsString

java.lang.String getAccessAsString()
Get the String representation of the Attributes Access level.

Returns:
val String representation of Access level

getName

java.lang.String getName()
Get the Attributes name.

Returns:
String the Attributes name

getProperties

java.util.Properties getProperties()
Returns the Properties for the Attribute. Notice: The returned Properties is a "deep copy", not a reference to the internal Properties.

Returns:
Properties the current Attribute properties

getPropertiesSize

int getPropertiesSize()
Returns the quantity of Properties.

Returns:
int quantity of Properties

getProperty

java.lang.String getProperty(java.lang.String key)
Get the Property value from the Attribute. If the property does not exist, a null value is returned. Note: the returned value (String) is a copy of the internal value.

Parameters:
key - the name of the Property
Returns:
val the value of the Property

getState

State getState()
Get the Attributes State.

Returns:
state State for the Attribute

getType

DataType getType()
Get the Attributes type.

Returns:
int the Attributes type

getTypeAsString

java.lang.String getTypeAsString()
Get the Attributes type, as a String.

Returns:
String the String representation of the type

getValue

java.lang.Object getValue()
Get the Attributes value.

Returns:
Object the Attributes value

getValueAsString

java.lang.String getValueAsString()
Get the attributes value as a String, regardless of it's internal type. String[] is enclosed with bracets and values are comma delimited Int and Booleans use their toString() value.

Returns:
String a String representation of the internal value

isEncrypted

boolean isEncrypted()
Returns TRUE if the value is encrypted.

Returns:
boolean is the value encrypted

isMultivalued

boolean isMultivalued()
Return TRUE if the actual value is contains muliple values.

Returns:
boolean is it multi-valued

isReadOnly

boolean isReadOnly()
Get the Attributes read only flag.

Returns:
boolean the read only flag

isRequired

boolean isRequired()
Get the Attributes required flag.

Returns:
boolean the required flag

isVirtual

boolean isVirtual()
Get the Attributes virtual flag.

Returns:
boolean the virtual flag

setAccess

void setAccess(AttributeIF.Access access)
Set the Attributes Access level.

Parameters:
access - Access level

setAccess

void setAccess(java.lang.String access)
Set the Attribute Access level.

Parameters:
access - String representation of the level

setAllowMultivalue

void setAllowMultivalue(boolean value)
Set the flag to define if the Attribute allows multivalues.

Parameters:
value -

setEncrypted

void setEncrypted(boolean bEncrypted)
Set the flag to define if the Attribute value is encrypted.

Parameters:
bEncrypted -

setProperties

void setProperties(java.util.Properties props)
Sets / Replaces the Attributes Properties.

Parameters:
props - a Properties object

setProperty

void setProperty(java.lang.String key,
                 java.lang.String value)
Add the key / value as a Property to the Attribute.

Parameters:
key - the name of the Property
value - the value of the Property

setReadOnly

void setReadOnly(boolean value)
Set the Attributes read only flag.

Parameters:
value - flag to define if the Attribute is read only

setRequired

void setRequired(boolean bool)
Set the Attributes required flag.

Parameters:
bool - flag to define if the Attribute is required

setState

void setState(State state)
Set the Attributes State.

Parameters:
state - State

setType

void setType(DataType type)
Set the Attributes type (enum). Notice: The type is automatically set based on the Attributes value. If the type does not match the value, there will be unpredictable behavior.

Parameters:
type - DataType

setValue

void setValue(boolean value)
Set the Attributes value to a single Boolean. The Type will be automatically set.

Parameters:
value - boolean

setValue

void setValue(java.lang.Boolean value)
Set the Attributes value to a single Boolean. The Type will be automatically set.

Parameters:
value - Boolean

setValue

void setValue(boolean[] value)
Set the Attributes value to a Boolean array. The Type will be automatically set.

Parameters:
value - boolean[]

setValue

void setValue(java.lang.Boolean[] value)
Set the Attributes value to a Boolean array. The Type will be automatically set.

Parameters:
value - Boolean[]

setValue

void setValue(int value)
Set the Attributes value to a single Integer. The Type will be automatically set.

Parameters:
value - int

setValue

void setValue(int[] value)
Set the Attributes value to a Integer array. The Type will be automatically set.

Parameters:
value - int[]

setValue

void setValue(java.lang.Integer value)
Set the Attributes value to a single Integer. The Type will be automatically set.

Parameters:
value - Integer

setValue

void setValue(java.lang.Integer[] value)
Set the Attributes value to a Integer array. The Type will be automatically set.

Parameters:
value - Integer[]

setValue

void setValue(java.lang.Object value)
Set the Attributes value to the single Object. The Type will be automatically set.

Parameters:
value - Object

setValue

void setValue(java.lang.Object[] value)
Set the Attributes value to the Object array. The Type will be automatically set.

Parameters:
value - Object[]

setValue

void setValue(java.lang.String value)
Set the Attributes value to a single String. The Type will be automatically set.

Parameters:
value - String

setValue

void setValue(java.lang.String[] value)
Set the Attributes value to a String array. The Type will be automatically set.

Parameters:
value - String[]

setVirtual

void setVirtual(boolean bool)
Set the Attributes virtual flag.

Parameters:
bool - flag to define if the Attribute is virtual


View/submit a bug or feature

For further API reference and developer documentation, see www.openptk.org. That documentation contains more detailed, developer-targeted descriptions, definitions of terms, workarounds, and working code examples.

Copyright (C) 2008-2012, Project OpenPTK. All Rights Reserved