|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectschmitzm.data.property.PropertyUtil
public class PropertyUtil
Diese Klasse beinhaltet statische Hilfsmethoden fuer das Arbeiten mit
Property
und Properties
.
Constructor Summary | |
---|---|
PropertyUtil()
|
Method Summary | |
---|---|
static String |
cutArrayCoordinates(String objectSpec)
Entfernt eine etwaige Koordinaten-Definition (in runden Klammern) am Ende eines Strings. |
static int[] |
getArrayCoordinates(String objectSpec)
Ermittelt die am Ende eines Strings in runden Klammern spezifierten Koordinaten. |
static Property |
getProperty(Properties propObject,
String propSuffix)
Liefert eine Eigenschaft eines Properties -Objekt. |
static Property |
getProperty(Properties propObject,
String propSuffix,
char sep)
Liefert den Wert eine Eigenschaft. |
static Object |
getPropertyValue(Property prop,
int... coord)
Wraps a Property to an appropriate java object. |
static void |
setPropertyValue(ValueProperty prop,
Object value,
int... coord)
Sets the value of a Property with an appropriate java object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyUtil()
Method Detail |
---|
public static Property getProperty(Properties propObject, String propSuffix)
Properties
-Objekt.
Enthaelt das Properties
-Objekt keine Eigenschaft mit dem
angegebenen Namen, wird dieser sukzessive verkuerzt (Punkt-Notation)
bis im Objekt eine entsprechende Eigenschaft gefunden wird.
In diesem Fall muss es sich beim Wert dieser Eigenschaft
wiederum um ein Properties
-Objekt handeln, um den "abgeschnittenen"
Teil des Eigenschaft-Names rekursiv zu verarbeiten.
propObject
- Properties
-ObjektpropSuffix
- Name der Eigenschaft (bzw. mehrere Eigenschaften
durch "." getrennt)
null
wenn die Eigenschaft nicht gefunden werden kannpublic static Property getProperty(Properties propObject, String propSuffix, char sep)
Properties
-Objekt
keine Eigenschaft mit dem angegebenen Namen, wird dieser sukzessive
verkuerzt (Punkt-Notation) bis im Objekt eine entsprechende Eigenschaft
gefunden wird. In diesem Fall muss es sich beim Wert dieser Eigenschaft
wiederum um ein Properties
-Objekt handeln, um den "abgeschnittenen"
Teil des Eigenschaft-Names rekursiv zu verarbeiten.
propObject
- Properties
-ObjektpropSuffix
- Name der Eigenschaft (bzw. mehrere Eigenschaften
getrennt durch das sep
-Zeichen)sep
- Trenn-Zeichen, mit dem in propSuffix
mehere Eigenschaften
von einander getrennt sind
null
wenn die Eigenschaft nicht gefunden werden kannpublic static int[] getArrayCoordinates(String objectSpec)
objectSpec
- ein String
public static String cutArrayCoordinates(String objectSpec)
objectSpec
- ein String
public static Object getPropertyValue(Property prop, int... coord)
Property
to an appropriate java object.
ScalarProperty
: wrapped to its (single) valueListProperty
: wrapped to an appropriate Vector
which
contains the ListProperty
valuesMatrixProperty
: wrapped to an appropriate native Object[]..[]
which contains the MatrixProperty
values
prop
- a propertycoord
- if specified, the appropiate element of the ListProperty
or MatrixProperty
is returned, instead of the complete
list or matrix!
public static void setPropertyValue(ValueProperty prop, Object value, int... coord)
Property
with an appropriate java object.
ScalarProperty
: sets the property's (single) value to aValue
ListProperty
: clears the list and fills it with the
elements of aValue
(must be an Object[]
or an Iterable
)MatrixProperty
: fills the matrix with the elements of
aValue
(must be an Object[]
)
prop
- a propertyvalue
- a value the property is set tocoord
- if specified, only the appropiate element of the ListProperty
or MatrixProperty
is set with aValue
,
instead of the complete list or matrix!
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |