com.starteam
Class Property

java.lang.Object
  extended by com.starteam.Property
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
ContentProperty, EnumeratedProperty, LinkProperty, ObjectProperty, ScalarProperty, VectorProperty

public abstract class Property
extends java.lang.Object

Each different Type supported by a StarTeam Server (e.g. File, Change Request, Topic...) has an associated set of properties. The Property class provides information about a Type's property.


Nested Class Summary
static class Property.MetaData
          server stored meta data available for a property This definition is only useful for application developers who intend to subclass items & properties to create extended property definitions
static class Property.WebCacheProperty
          Base accessor for cached SDK objects encapsulating the statefulness of objects obtained from the artifact cache.
 
Method Summary
static boolean areValuesEqual(java.lang.Object v1, java.lang.Object v2)
          Compares two property values for equality.
 Property copy()
          Creates a copy of this property object.
 boolean equals(java.lang.Object o)
          return true if the two properties are equal
 java.lang.String getDebugString()
          Returns a String representation of this property that may be useful for debugging purposes.
 PropertyCollection getDependentProperties()
          Returns the set of properties that the computation of this property's value depends upon.
 java.lang.String getDisplayName()
          Returns this property's display name.
 Translations getDisplayNameTranslations()
          Returns a copy of the display name translations for this property.
abstract  java.lang.String getDisplayValue(java.lang.Object value)
          Converts the given property value to a string suitable for display.
 java.lang.Object getGenericDefaultValue()
          Returns the default value for this property.
 int getID()
          Returns this property's internal ID.
 java.lang.String getName()
          Returns this property's internal name.
 Server getServer()
          returns the Server that this property belongs to
 Type getType()
          Returns the Type object that has this property as one of its properties.
 int hashCode()
          return a hash code for this property
 boolean isAdvanced()
          Return true is the property is considered "advanced".
 boolean isCalculated()
          Returns true if the property is calculated on-the-fly by the server as opposed to being stored on the server.
 boolean isClientCalculated()
          Return true is the property is calculated in the fly by the client.
 boolean isDescriptor()
          Returns true if the property is considered a descriptor.
 boolean isDirty()
          Is this property instance dirty?
 boolean isDisabled()
          Return true if the property is flagged as disabled.
 boolean isEnabled()
          Return true if the property is flagged as enabled.
 boolean isEqualTo(Property property)
          Compares two Property objects.
 boolean isGenericCalculated()
          Returns true if the property is calculated on the server by the component.
 boolean isHeader()
          Returns true if this property is stored in the repository database and if the database field is a header field.
 boolean isItemProperty()
          An item-level property.
 boolean isLegalValue(java.lang.Object object)
          Returns true if the specified object is a legal value for this property.
 boolean isNew()
          Is this property instance new?
 boolean isPrimaryDescriptor()
          Return true if this property is the primary descriptor for this property's owning type.
 boolean isQueryRelationSupported(QueryPart.Relation operator)
          Returns true if this property supports the specified query operator(s)
 boolean isRequired()
          Returns true if a value for this property is required; valid for user-defined properties only.
 boolean isRestricted()
          Return true if this is a restricted property.
 boolean isRevisionIndependent()
          Returns true if this property is revision-independent (for example, "FlagUserList", "ReadStatusUserList").
 boolean isServerCalculated()
          Return true if the property if calculated on the fly by the server.
 boolean isSortByTextValueSupported()
          Returns true if this property supports Sort by TextValue for the specified Query Operator
 boolean isStored()
          Returns true if the property is stored in the server's database.
 boolean isSysDefined()
          Returns true if the property is a built-in StarTeam property (as opposed to a custom property).
 boolean isUserCustomized()
          Returns true if this property is a user defined property.
 boolean isUserDefined()
          Returns true is the property was user defined through the repository customization feature.
 boolean isUserModifiable()
          Return true if the property is flagged as user modifiable.
 boolean isViewSpecific()
          Returns true if this property is view-specific (for example, "ExclusiveLocker", "BranchOnChange").
static PropertyCollection resolveAllDependencies(PropertyCollection props)
          This will return the full set of dependent properties based on the specified set.
 void setDescriptor()
          Assign this property as a (non-primary) Descriptor Several properties on a type can be descriptors for that type This assignment may be made for a new type that has not been saved to the server and the value is used simply to ensure the construction of the type xml
 void setDisplayName(java.lang.String displayName)
          Sets the display name for this property.
 void setDisplayNameTranslations(Translations t)
          Sets a copy of the display name translations for this property.
 void setEnabled(boolean bIsEnabled)
          Enables/disables the property
 void setGenericDefaultValue(java.lang.Object value)
          Sets the Generic Default Value for this property
 void setPrimaryDescriptor()
          Assign this property as the Primary Descriptor Only 1 property on a type can be the primary descriptor for the type If more than 1 property is assigned to be the primary descriptor, the server will throw an exception This assignment may be made for a new type that has not been saved to the server and the value is used simply to ensure the construction of the type xml
 void setRequired(boolean bIsRequired)
          Mark this property as required
 java.lang.String toString()
          Returns the name of the property.
 java.lang.String toXml()
          Returns an xml representation of this property The xml representation is used to specify the property definition when creating custom components
 void update()
          If this property is new or dirty, saves changes to the repository
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getType

public Type getType()
Returns the Type object that has this property as one of its properties.

Returns:
the Type object that "owns" this property.

getID

public int getID()
Returns this property's internal ID.

Returns:
this property's internal ID.

equals

public boolean equals(java.lang.Object o)
return true if the two properties are equal

Overrides:
equals in class java.lang.Object
Parameters:
o - the Property to compare for equality
Returns:
boolean true if the two properties are equal

hashCode

public int hashCode()
return a hash code for this property

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code for this property

getName

public java.lang.String getName()
Returns this property's internal name.

Returns:
this property's internal name.

getDisplayName

public java.lang.String getDisplayName()
Returns this property's display name.

Returns:
this property's display name.

setDisplayName

public void setDisplayName(java.lang.String displayName)
Sets the display name for this property.

Parameters:
displayName - this property's display name.

getDisplayNameTranslations

public Translations getDisplayNameTranslations()
Returns a copy of the display name translations for this property. Will return null for client calculated properties. When working against servers that do not support display name translations the returned Translations object will only have the default value set.

Returns:
a copy of the Display Name Translations

setDisplayNameTranslations

public void setDisplayNameTranslations(Translations t)
Sets a copy of the display name translations for this property.

Parameters:
t - the translation to copy

isStored

public boolean isStored()
Returns true if the property is stored in the server's database. (Some properties may be stored and others calculated on the fly by either the client or server).

Returns:
true if the property is stored in the server's database.

isCalculated

public boolean isCalculated()
Returns true if the property is calculated on-the-fly by the server as opposed to being stored on the server.

Returns:
true if this property is caclulated by the server rather than stored in the db

isHeader

public boolean isHeader()
Returns true if this property is stored in the repository database and if the database field is a header field.

Returns:
true if this property is stored in a header field in the database

isSysDefined

public boolean isSysDefined()
Returns true if the property is a built-in StarTeam property (as opposed to a custom property).

Returns:
true if the property is a built-in StarTeam property.

isUserDefined

public boolean isUserDefined()
Returns true is the property was user defined through the repository customization feature.

Returns:
true if the property is user defined.

isClientCalculated

public boolean isClientCalculated()
Return true is the property is calculated in the fly by the client.

Returns:
true if the property is client calculated.

isServerCalculated

public boolean isServerCalculated()
Return true if the property if calculated on the fly by the server.

Returns:
true if the property if server calculated.

isGenericCalculated

public boolean isGenericCalculated()
Returns true if the property is calculated on the server by the component.

Returns:
true if the property is calculated on the server by the component.

isPrimaryDescriptor

public boolean isPrimaryDescriptor()
Return true if this property is the primary descriptor for this property's owning type. Each Type can have only one primary descriptor.

Returns:
true if the property if the primary descriptor.

setPrimaryDescriptor

public void setPrimaryDescriptor()
Assign this property as the Primary Descriptor Only 1 property on a type can be the primary descriptor for the type If more than 1 property is assigned to be the primary descriptor, the server will throw an exception This assignment may be made for a new type that has not been saved to the server and the value is used simply to ensure the construction of the type xml


setDescriptor

public void setDescriptor()
Assign this property as a (non-primary) Descriptor Several properties on a type can be descriptors for that type This assignment may be made for a new type that has not been saved to the server and the value is used simply to ensure the construction of the type xml


isDescriptor

public boolean isDescriptor()
Returns true if the property is considered a descriptor. A Type may have multiple descriptors.

Returns:
true is this property is a descriptor.

isUserModifiable

public boolean isUserModifiable()
Return true if the property is flagged as user modifiable. This is not enforced so some properties that are marked as non-modifiable can actually be modified. This is more of a clue for the StarTeam GUI whether or not to allow the user to edit the property.

Returns:
true is the property is flagged as user modifiable.

isAdvanced

public boolean isAdvanced()
Return true is the property is considered "advanced". Generally this means the property is used internally and would be meaningless to an end user.

Returns:
true if the property is considered advanced.

isDisabled

public boolean isDisabled()
Return true if the property is flagged as disabled. Generally disabled properties should not be displayed nor edited by end users.

Returns:
true is the property is flagged as disabled.

isEnabled

public boolean isEnabled()
Return true if the property is flagged as enabled.

Returns:
true is the property is flagged as enabled.

setEnabled

public void setEnabled(boolean bIsEnabled)
Enables/disables the property

Parameters:
bIsEnabled - true to enable this property

isRestricted

public boolean isRestricted()
Return true if this is a restricted property.

Returns:
true if this is a restricted property.

isUserCustomized

public boolean isUserCustomized()
Returns true if this property is a user defined property.

Returns:
true if this property is a user defined property.

isRequired

public boolean isRequired()
Returns true if a value for this property is required; valid for user-defined properties only.

Returns:
true if a value for this property is required; valid for user-defined properties only.

setRequired

public void setRequired(boolean bIsRequired)
Mark this property as required

Parameters:
bIsRequired - true to mark this property as required

isViewSpecific

public boolean isViewSpecific()
Returns true if this property is view-specific (for example, "ExclusiveLocker", "BranchOnChange"). Used only for server-calculated properties. Available only for StarTeam server versions 5.1 and later.

Returns:
true if this property is view-specific (for example, "ExclusiveLocker", "BranchOnChange"). Used only for server-calculated properties. Available only for StarTeam server versions 5.1 and later.

isRevisionIndependent

public boolean isRevisionIndependent()
Returns true if this property is revision-independent (for example, "FlagUserList", "ReadStatusUserList"). Used only for server-calculated properties. Available only for StarTeam server versions 5.1 and later.

Returns:
true if this property is revision-independent (for example, "FlagUserList", "ReadStatusUserList"). Used only for server-calculated properties. Available only for StarTeam server versions 5.1 and later.

isItemProperty

public boolean isItemProperty()
An item-level property. Currently, the only item-level properties supported are those of type LinkProperty.

Returns:
true if this property is an item property; false otherwise.

isLegalValue

public boolean isLegalValue(java.lang.Object object)
Returns true if the specified object is a legal value for this property.

Parameters:
object - the object being checked as a legal value for this property.
Returns:
true is the specified object is a legal value for this property.

getDependentProperties

public PropertyCollection getDependentProperties()
Returns the set of properties that the computation of this property's value depends upon. If none, the list will be empty (will not return null). Only client calculated properties will have dependencies. It is possible that one of the returned properties also has dependencies.

Returns:
the properties that this property depends upon
See Also:
Property.resolveAllDependencies(com.starteam.PropertyCollection), Property.isClientCalculated()

resolveAllDependencies

public static PropertyCollection resolveAllDependencies(PropertyCollection props)
This will return the full set of dependent properties based on the specified set. The returned set will include the specified properties. The returned set will not have duplicate elements.

Parameters:
props - the properties whose dependencies are to be computed
See Also:
Property.getDependentProperties()

toString

public java.lang.String toString()
Returns the name of the property.

Overrides:
toString in class java.lang.Object
Returns:
the name of the property.

toXml

public java.lang.String toXml()
Returns an xml representation of this property The xml representation is used to specify the property definition when creating custom components

Returns:
an xml representation of this property

getDebugString

public java.lang.String getDebugString()
Returns a String representation of this property that may be useful for debugging purposes.

Returns:
a debug string for this property.

copy

public Property copy()
Creates a copy of this property object. Useful to applications that want to save a snapshot of the Property in a given state, for example, before calling Server.refreshTypes().

The copied property will have the same parent Type as the original property. The Type object is not copied.

For enumerated properties, the enumerated values are copied.

For client-calculated properties, the individual property objects that are included in the list of dependent properties are not copied.

Returns:
A copy of this property object.
See Also:
Property.isEqualTo(com.starteam.Property)

isEqualTo

public boolean isEqualTo(Property property)
Compares two Property objects.

The parent Types are compared by ClassID.

For enumerated properties, the enumerated values are compared using a deep comparison.

For client-calculated properties, the two Property objects must have the same dependents. Dependent properties are compared by property ID.

Parameters:
property - the property to compare
Returns:
true if no differences were found.
See Also:
Property.copy()

areValuesEqual

public static boolean areValuesEqual(java.lang.Object v1,
                                     java.lang.Object v2)
Compares two property values for equality. Handles all StarTeam data types in a "natural" fashion. For example, two IDARRAY values are considered equal if they contain the same IDs in the same order.

Parameters:
v1 - Property value.
v2 - Another property value.
Returns:
true if the two values are equal.

getDisplayValue

public abstract java.lang.String getDisplayValue(java.lang.Object value)
Converts the given property value to a string suitable for display.

Parameters:
value - A legal value for this property.
Returns:
A string representation of the value

update

public void update()
If this property is new or dirty, saves changes to the repository


isNew

public boolean isNew()
Is this property instance new?

Returns:
true if the property is new

isDirty

public boolean isDirty()
Is this property instance dirty?

Returns:
true if the property is dirty

getServer

public Server getServer()
returns the Server that this property belongs to

Returns:
the Server that this property belongs to

isQueryRelationSupported

public boolean isQueryRelationSupported(QueryPart.Relation operator)
Returns true if this property supports the specified query operator(s)

Parameters:
operator - Query Relation
Returns:
true if the query relation is supported by this property

isSortByTextValueSupported

public boolean isSortByTextValueSupported()
Returns true if this property supports Sort by TextValue for the specified Query Operator

Returns:
boolean

getGenericDefaultValue

public java.lang.Object getGenericDefaultValue()
Returns the default value for this property.

Returns:
the property's default value.

setGenericDefaultValue

public void setGenericDefaultValue(java.lang.Object value)
Sets the Generic Default Value for this property

Parameters:
value - Object


StarTeam SDK 14.0, Build 21
Copyright © 2003-2012 Borland Software Corporation. All rights reserved.