|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.starteam.Property
com.starteam.EnumeratedProperty
public class EnumeratedProperty
This class represents a property whose value is an enumeration Historically,
enumerations were single select, i.e. only a single enumerated value could be
sent to or received from the starteam server, in the context of an
EnumeratedProperty. However, from StarTeam server 12.0 on, the server
supports multi select enumerated lists. i.e. an application may create a
custom multi-select enumerated property and send/receive more than one
enumerations as the value of the property for the artifact For consistency,
the SDK api TypedResource.getValue(Property) always returns an array
of EnumeratedValue's, whether the property type is single or multi-select.
For single select, the array will contain 0 or 1 enumerated value's
(depending upon whether any value has been selected or not) For multi select
lists, the array will contain 0 or more enumerated values. For
EnumeratedProperties, the SDK api
TypedResource.setValue(Property, Object) takes either a single
Enumerated Value or an array of EnumeratedValues in the second parameter. If
a single value is presented, a single value is saved irrespective of whether
the list is single or multi select. On the other hand, if an array of values
(> 1) is presented, but the property type is single select, an
SKDRuntimeException will be thrown
EnumeratedValue| Nested Class Summary | |
|---|---|
static class |
EnumeratedProperty.WebCacheEnumeratedProperty
Base accessor for cached SDK objects encapsulating the statefulness of objects obtained from the artifact cache. |
| Nested classes/interfaces inherited from class com.starteam.Property |
|---|
Property.MetaData, Property.WebCacheProperty |
| Field Summary | |
|---|---|
static int |
VALUE_NOT_SET
Represents "value not set" for an EnumeratedProperty. |
| Method Summary | |
|---|---|
Property |
copy()
Creates a copy of this EnumeratedProperty object. |
EnumeratedValue |
createValue(java.lang.String displayName)
Create a new Enumerated Value for this property. |
EnumeratedValue |
findValue(int enumCode)
Finds an existing EnumeratedValue by code. |
EnumeratedValue |
findValue(java.lang.String internalName)
Finds an existing EnumeratedValue by internal name. |
EnumeratedValue[] |
getAllValues()
A convenience method for returning an array of the possible values of an enumerated property.Optimized to run internal queries just once to build up the list of all values |
EnumeratedValue[] |
getDefaultValues()
Returns the default array of enumerated values for this Property. |
java.lang.String |
getDisplayValue(java.lang.Object value)
Converts the given property value to a string suitable for display. |
java.lang.String |
getEnumDisplayName(int value)
A convenience method for returning the display name for a given value of an enumerated property. |
EnumeratedValue[] |
getSortedValues()
Returns an array of all the enumerated values for this property, sorted by the specified sort order |
EnumeratedValue[] |
getValues()
Returns an array of the enumerated values of this property. |
boolean |
isEqualTo(Property property)
Compares two EnumeratedProperty objects. |
boolean |
isHierarchicalEnumeration()
Returns true if at least one of the enumerated values has child values, or false if every enumerated value is a root value with no children |
boolean |
isMultiSelectable()
Returns true if this Enumerated Property supports selecting more than one enumerated value at a time. |
boolean |
isQueryRelationSupported(QueryPart.Relation operator)
Returns true if this property supports the specified query operator(s) |
boolean |
isStatusProperty()
Returns true if this Enumerated Property is the status property for the owning type. |
QueryPart |
newQueryPart(QueryPart.Relation relation,
EnumeratedValue value)
Creates a new query expression that tests this property. |
QueryPart |
newQueryPart(QueryPart.Relation relation,
EnumeratedValue[] values)
Creates a new query expression that tests this property. |
QueryPart |
newQueryPart(QueryPart.Relation relation,
int value)
Returns a new QueryPart that tests this property against the given value using the given query relation |
void |
setDefaultValues(EnumeratedValue[] defaultValues)
Sets an array of enumerated values to be the default for the property. |
void |
setStatusProperty(boolean enable)
set this property to be the status property for the owning type. |
void |
setValues(EnumeratedValue[] values)
Sets an array of the enumerated values for this property Applications that track sort order, indentation, etc on their own and/or create enumerated values using the standard constructors must use this api to assign all enumerated values to the enumerated property Applications that use this EnumeratedProperty itself to auto generate enum codes and use the EnumeratedValue helper api's such as EnumeratedValue.addChild(EnumeratedValue) or EnumeratedValue.setAfter(EnumeratedValue)
can directly update this property when done, without calling this method. |
BooleanProperty |
toBooleanProperty(EnumeratedValue falseValue,
EnumeratedValue trueValue)
Convert an existing EnumeratedProperty into a BooleanProperty |
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 |
| Field Detail |
|---|
public static final int VALUE_NOT_SET
| Method Detail |
|---|
public EnumeratedValue[] getDefaultValues()
public void setDefaultValues(EnumeratedValue[] defaultValues)
defaultValues - the new array of default values
SDKRuntimeException - if attempting to set multiple defaults for single select
enumerated property.public EnumeratedValue[] getSortedValues()
public BooleanProperty toBooleanProperty(EnumeratedValue falseValue,
EnumeratedValue trueValue)
The old EnumeratedProperty is replaced by the new BooleanProperty within the parent Type's properties collection. The new property is dirty; to save changes, you must call Property.update(). The old property is invalid and should be discarded.
falseValue - The EnumeratedValue that represents FalsetrueValue - The EnumeratedValue that represents True
public EnumeratedValue[] getValues()
For hierarchical enumerations, only root enumerated values are listed. Other values may be found by traversing the enum hierarchy
public EnumeratedValue createValue(java.lang.String displayName)
displayName - the display name for the new value
public boolean isHierarchicalEnumeration()
public boolean isMultiSelectable()
public boolean isStatusProperty()
public void setStatusProperty(boolean enable)
enable - true to set this property to be the status propertypublic EnumeratedValue findValue(int enumCode)
enumCode - the code
public EnumeratedValue findValue(java.lang.String internalName)
internalName - the internal name
public void setValues(EnumeratedValue[] values)
EnumeratedValue.addChild(EnumeratedValue) or EnumeratedValue.setAfter(EnumeratedValue)
can directly update this property when done, without calling this method.
The helper api's automatically reassign sort order, indent levels etc on this owning
property and eliminate the need for the application to do so.
Note that applications which call setValues() directly are responsible for ensuring
that the entire array of values passed in are correct and consistent and up-to-date
w.r.t. the data they intend to save to the repository. specifically, a call to
setValues() wipes out the incremental changes made by calls to the helper api's
values - an array of EnumeratedValue objectspublic EnumeratedValue[] getAllValues()
public java.lang.String getEnumDisplayName(int value)
value - one of the possible enumerated values of the indicated
property
public QueryPart newQueryPart(QueryPart.Relation relation,
int value)
relation - intvalue - int
public QueryPart newQueryPart(QueryPart.Relation relation,
EnumeratedValue value)
relation - The query relation.value - The enumerated value to be tested.
public boolean isQueryRelationSupported(QueryPart.Relation operator)
isQueryRelationSupported in class Propertyoperator - Query Relation
public QueryPart newQueryPart(QueryPart.Relation relation,
EnumeratedValue[] values)
relation - The query relation.values - The enumerated values to be tested.
public java.lang.String getDisplayValue(java.lang.Object value)
getDisplayValue in class Propertyvalue - A legal value for this property.
public Property copy()
The copied property will have the same parent Type as the original property. The Type object is not copied.
copy in class PropertyEnumeratedProperty.isEqualTo(com.starteam.Property)public boolean isEqualTo(Property property)
isEqualTo in class Propertyproperty - the property to compare
EnumeratedProperty.copy()public void update()
update in class Property
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||