|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.rational.rpe.common.utils.PropertyUtils
public class PropertyUtils
Utility methods for manipulating Property
objects
Constructor Summary | |
---|---|
PropertyUtils()
|
Method Summary | |
---|---|
static Property |
clone(Property source)
Creates a clone of the source property |
static Property |
cloneSameValue(Property source)
Creates a clone of this property, but assigns the same value to it |
static boolean |
compareProperties(java.util.Collection<Property> properties1,
java.util.Collection<Property> properties2)
Compares the two property collections |
static boolean |
compareProperties(Property prop1,
Property prop2)
Compares the two properties |
static java.lang.String |
extractSystemVariables(java.lang.String prop)
Extract external variable in properties, such as path or URI properties. |
static Property |
findCreateProperty(Feature context,
java.lang.String propname)
Searches the context feature for a property named propname . |
static Property |
findFirstProperty(Feature context,
java.lang.String featurePath,
java.lang.String propertyName)
Deprecated. |
static java.util.List<Property> |
findPropertiesByName(Feature context,
java.lang.String name)
Searches the context feature for properties with the given name. |
static java.util.List<Property> |
findPropertiesByType(Feature context,
java.lang.String type)
Deprecated. |
static Property |
findProperty(java.util.Collection<Property> properties,
java.lang.String name)
Searches the properties collection for a property with the given name |
static Property |
findProperty(Feature context,
java.lang.String name)
Searches the context feature for a property with the given name . |
static Property |
findProperty(java.util.List<Property> properties,
java.lang.String name)
Finds the property that is named name in the properties collection. |
static Property |
findPropertyDeep(Feature context,
java.lang.String name)
Searches the context feature for a property with the given name . |
static java.lang.String |
getPropertyRawValue(Property prop,
java.lang.String emptyValue)
|
static boolean |
hasPropertiesWithType(Feature context,
java.lang.String type)
Searches the context feature for properties with the given type. |
static Property |
makeProperty(java.lang.String proptag,
java.lang.String valtag,
java.lang.String valcontent)
Shortcut for creating a property with the given tag and value |
static boolean |
removeFeature(Feature context,
Feature removed)
Deprecated. |
static boolean |
removeProperty(Feature context,
Property property)
Deprecated. |
static boolean |
removeProperty(Feature context,
java.lang.String name)
Removes the first occurrence of a property with name name from the context feature. |
static void |
setProperty(Feature context,
java.lang.String propname,
Value value)
Searches the context feature for a property named propname and sets its value to value . |
static void |
setPropertyValue(Property prop,
Value value)
Deprecated. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyUtils()
Method Detail |
---|
public static Property makeProperty(java.lang.String proptag, java.lang.String valtag, java.lang.String valcontent)
proptag
- - the tag (name) of the newly created propertyvaltag
- - the tag of the value ( can be null)valcontent
- - the content of the value ( can be null)
public static Property clone(Property source)
source
property
source
-
public static Property cloneSameValue(Property source)
source
-
public static Property findProperty(java.util.Collection<Property> properties, java.lang.String name)
properties
collection for a property with the given name
properties
- name
-
public static Property findProperty(Feature context, java.lang.String name)
context
feature for a property with the given name
. Only the top-level properties of the context
feature are searched.
This is an alias for Feature.getProperty(String)
.
properties
- name
-
public static Property findPropertyDeep(Feature context, java.lang.String name)
context
feature for a property with the given name
. The search is recursive.
properties
- name
-
@Deprecated public static Property findFirstProperty(Feature context, java.lang.String featurePath, java.lang.String propertyName)
@Deprecated public static java.util.List<Property> findPropertiesByType(Feature context, java.lang.String type)
public static boolean hasPropertiesWithType(Feature context, java.lang.String type)
context
feature for properties with the given type. The search is not recursive.
context
- - the feature to be searchedtype
- - the type to search for
public static java.util.List<Property> findPropertiesByName(Feature context, java.lang.String name)
context
feature for properties with the given name. The search is not recursive.
context
- - the feature to be searchedname
- - the name to search for
public static boolean compareProperties(Property prop1, Property prop2)
prop1
- prop2
-
public static boolean compareProperties(java.util.Collection<Property> properties1, java.util.Collection<Property> properties2)
prop1
- prop2
-
public static Property findProperty(java.util.List<Property> properties, java.lang.String name)
name
in the properties
collection.
properties
- name
-
properties
list named name
or null if such a property is not found.public static boolean removeProperty(Feature context, java.lang.String name)
name
name from the context
feature.
context
- name
-
@Deprecated public static boolean removeProperty(Feature context, Property property)
@Deprecated public static boolean removeFeature(Feature context, Feature removed)
public static void setProperty(Feature context, java.lang.String propname, Value value)
context
feature for a property named propname
and sets its value to value
. If no such property is found, a new property is created and its value is set to value
context
- propname
- value
- public static Property findCreateProperty(Feature context, java.lang.String propname)
context
feature for a property named propname
. If no such property is found, a new property is created and added to the context.
context
- the feature where the property is to be searched forpropname
- the name of the searched property
public static java.lang.String getPropertyRawValue(Property prop, java.lang.String emptyValue)
prop
- emptyValue
-
@Deprecated public static void setPropertyValue(Property prop, Value value)
public static java.lang.String extractSystemVariables(java.lang.String prop)
prop
- the value. Can be null
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |