public class PropertyUtils
extends java.lang.Object
Constructor and Description |
---|
PropertyUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
correctedValue(java.lang.Object value,
java.lang.String err,
StringHolder errMsg) |
static CompositeProperty |
createInstance(PropertyInfo info,
HasProperties host)
Creates a default instance of a composite property.
|
static java.util.LinkedList<Property> |
createProperties(HasProperties host) |
static java.util.LinkedList<Property> |
createProperties(HasProperties host,
java.lang.String[] excludeProps) |
static boolean |
equalValues(java.lang.Object val1,
java.lang.Object val2)
Returns true if two objects are equal, including if they are both
equal to
null . |
static java.lang.Class<?>[] |
findCompositePropertySubclasses(PropertyInfo info) |
static java.lang.Object |
illegalValue(java.lang.String err,
StringHolder errMsg) |
static boolean |
isConnectedToHierarchy(Property prop) |
static java.lang.String[] |
maybeInitializeValues(Property prop,
CompositeProperty prevValue) |
static void |
propagateExplicitProperty(HasProperties host,
java.lang.String propName,
java.lang.Object val)
Propagate a specific property contained in a particular host to any
descendant nodes in the associated hierarchy.
|
static void |
propagateRemoval(HasProperties host)
Updates a node hierarchy to reflect the removal of a property host.
|
static PropertyMode |
propagateValue(HasProperties host,
java.lang.String propName,
java.lang.Object value,
PropertyMode mode) |
static boolean |
propertiesMatch(PropertyInfo info1,
PropertyInfo info2) |
static void |
setInheritedValue(PropertyInfo info,
HasProperties host,
java.lang.Object value)
Sets the value of an inheritable property to an inherited value.
|
static PropertyMode |
setModeAndUpdate(HasProperties host,
java.lang.String propName,
PropertyMode oldMode,
PropertyMode newMode) |
static PropTreeCell |
updateAllInheritedProperties(HierarchyNode node)
Updates the all inherited properties within a specified hierarchy node and
all its descendants.
|
static void |
updateAndPropagateInheritedProperties(HasProperties host)
Updates all inherited properties within a host, and then propagates the
resulting values down throughout a node hierarchy.
|
static void |
updateCompositeProperty(CompositeProperty obj)
Updates the hierarchy to reflect property changes in a particular
composite property.
|
static void |
updateCompositeProperty(HasProperties host,
java.lang.String propName,
CompositeProperty oldObj,
CompositeProperty newObj)
Updates a composite property when it is introduced to a host.
|
static void |
updateInheritedProperties(CompositeProperty cprop,
HasProperties host,
java.lang.String cpropName)
Updates the inherited properties within a specified CompositeProperty, in
the context of a specified host and property name.
|
static void |
updateInheritedProperties(HierarchyNode node,
PropTreeCell inherited)
Updates the all inherited properties within a specified hierarchy node and
all its descendants.
|
static java.lang.Object |
validValue(java.lang.Object value,
StringHolder errMsg) |
public static java.lang.String[] maybeInitializeValues(Property prop, CompositeProperty prevValue)
public static java.lang.Class<?>[] findCompositePropertySubclasses(PropertyInfo info)
public static void propagateExplicitProperty(HasProperties host, java.lang.String propName, java.lang.Object val)
host
- host containing the properties to be propagatedpropName
- name of the propertyval
- value to be propagatedpublic static void setInheritedValue(PropertyInfo info, HasProperties host, java.lang.Object value)
set
method is to prevent the property's mode from being automatically set to
Explicit
.info
- property informationhost
- host of the propertyvalue
- value to set it topublic static void updateCompositeProperty(HasProperties host, java.lang.String propName, CompositeProperty oldObj, CompositeProperty newObj)
set
routine. The
routine will update the property and host information for the composite
property. Also, if the host is associated with a node hierarchy, then (1)
any inherited property values within the composite will be updated to
reflect the explicit settings of ancestor nodes, and (2) any explicit
property values will be propagated to descendant nodes.host
- host to which the composite property is being introducedpropName
- name of the composite property within the hostoldObj
- previous composite property, if any, or null
otherwisenewObj
- composite property which is being introducedpublic static void updateCompositeProperty(CompositeProperty obj)
obj
- composite property objectpublic static void updateInheritedProperties(CompositeProperty cprop, HasProperties host, java.lang.String cpropName)
cprop
- CompositeProperty to updatehost
- Host for this composite propertycpropName
- Name for the composite property within hosthostpublic static PropTreeCell updateAllInheritedProperties(HierarchyNode node)
If the node itself has inherited properties, then this routine returns a property tree giving the inherited values for thsese properties, which can be resused to set inherited values for another node with the same inherited properties and the same parent.
node
- hierarchy node which needs updatingpublic static void updateInheritedProperties(HierarchyNode node, PropTreeCell inherited)
updateInheritedProperties(node)
). It is the responsibility of the caller
to ensure that this property tree is consistent with the properties
exported by node.node
- hierarchy node which needs updatinginherited
- property tree giving inherited values for nodepublic static void propagateRemoval(HasProperties host)
host
- property host which has been removedpublic static void updateAndPropagateInheritedProperties(HasProperties host)
host
- property host which has been removedpublic static CompositeProperty createInstance(PropertyInfo info, HasProperties host)
info
- information about the propertyhost
- property host for this propertypublic static boolean propertiesMatch(PropertyInfo info1, PropertyInfo info2)
public static boolean equalValues(java.lang.Object val1, java.lang.Object val2)
null
.val1
- first value to compareval2
- second value to comparepublic static java.util.LinkedList<Property> createProperties(HasProperties host)
public static java.util.LinkedList<Property> createProperties(HasProperties host, java.lang.String[] excludeProps)
public static PropertyMode setModeAndUpdate(HasProperties host, java.lang.String propName, PropertyMode oldMode, PropertyMode newMode)
public static boolean isConnectedToHierarchy(Property prop)
public static PropertyMode propagateValue(HasProperties host, java.lang.String propName, java.lang.Object value, PropertyMode mode)
public static java.lang.Object validValue(java.lang.Object value, StringHolder errMsg)
public static java.lang.Object illegalValue(java.lang.String err, StringHolder errMsg)
public static java.lang.Object correctedValue(java.lang.Object value, java.lang.String err, StringHolder errMsg)