Package com.inductiveautomation.rm.base
Class RMKeyChain
java.lang.Object
com.inductiveautomation.rm.base.RMKeyChain
This class evaluates a string expression on a given object: RMKeyChain.getValue(object, expression).
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic interfaceThis is interface is implemented by objects that can get key chain values themselves.static enum
- 
Constructor SummaryConstructorsConstructorDescriptionRMKeyChain(RMKeyChain.Op anOp) Node constructor.RMKeyChain(RMKeyChain.Op anOp, Object child) Node constructor.RMKeyChain(RMKeyChain.Op anOp, Object left, Object right) Node constructor.RMKeyChain(Object cond, Object tExp, Object fExp) Node constructor.
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds a child to the end of the keychain's child list.static voidaddFunctionClass(Class aClass) Adds a class to the list of classes that RM queries for functions.booleananyKeyReferencesKey(String aKey) Returns whether given key is used anywhere in expression.static StringReturns the last error encountered by the key chain parser and resets parser.static MapReturns a thread-local assignments map.static booleangetBoolValue(Object anObj, Object aKeyChain) Convenience - returns a boolean for an object and key chain.getChild(int anIndex) Returns the child at the given index in the keychain.intReturns the number of children in the keychain.getChildKeyChain(int i) Returns the child at the given index in the keychain as a keychain.getChildString(int i) Returns the child at the given index in the keychain as a string.static doublegetDoubleValue(Object anObj, Object aKeyChain) Convenience - returns a double for an object and key chain.static StringgetError()Returns the last error encountered by the key chain parser (or null).static floatgetFloatValue(Object anObj, Object aKeyChain) Convenience - returns a float for an object and key chain.static intgetIntValue(Object anObj, Object aKeyChain) Convenience - returns an int for an object and key chain.static RMKeyChaingetKeyChain(Object aSource) Returns a keyChain for aSource (should be a String or existing RMKeyChain).static ListgetListValue(Object anObj, Object aKeyChain) Convenience - returns a list for an object and key chain.static NumbergetNumberValue(Object anObj, Object aKeyChain) Convenience - returns a number for an object and key chain.getOp()Returns the top level operator of the keychain.static StringgetStringValue(Object anObj, Object aKeyChain) Convenience - returns a string for an object and key chain.getValue()Returns the value of the keychain.static ObjectgetValue(Object anObj, RMKeyChain aKeyChain) Returns the result of evaluating the given key chain on the given object.static ObjectReturns the result of evaluating the given key chain on the given object.static ObjectgetValue(Object aRoot, Object anObj, RMKeyChain aKeyChain) Returns the result of evaluating the given key chain on the given object.static <T> TReturns a key value if it is of given class (otherwise null).static ObjectgetValueImpl(Object aRoot, Object anObj, RMKeyChain aKeyChain) Returns the result of evaluating the given key chain on the given object.static ObjectgetValueList(List aList, RMKeyChain aKeyChain) Returns the result of evaluating the given key chain on the given list.Returns the value of the keychain as a string.booleanhasOp(RMKeyChain.Op anOp) Returns whether key contains given op.booleanReturns whether given key has a Page/PageMax key reference.static voidsetEnumValue(Object anObj, RMKeyChain aKeyChain) Sets the given value for the given key chain + property.static voidsetValue(Object anObj, RMKeyChain aKeyChain, Object aValue) Sets the given value for the given key chain + property.static voidSets the given value for the given key chain + property.static voidsetValueSafe(Object anObj, String aKey, Object aValue) Sets the value but only prints a warning if it fails.static voidsetValueSilent(Object anObj, String aKey, Object aValue) Tries to set value in given object, ignoring failure exceptions.subchain(int anIndex) Override to give list chance to implement this.toString()Returns a string representation of the key chain.
- 
Constructor Details- 
RMKeyChainNode constructor.
- 
RMKeyChainNode constructor.
- 
RMKeyChainNode constructor.
- 
RMKeyChainNode constructor.
 
- 
- 
Method Details- 
getKeyChainReturns a keyChain for aSource (should be a String or existing RMKeyChain).
- 
getAssignmentsReturns a thread-local assignments map.
- 
getOpReturns the top level operator of the keychain.
- 
getValueReturns the value of the keychain.
- 
getValueStringReturns the value of the keychain as a string.
- 
getChildCountpublic int getChildCount()Returns the number of children in the keychain.
- 
getChildReturns the child at the given index in the keychain.
- 
addChildAdds a child to the end of the keychain's child list.
- 
getChildStringReturns the child at the given index in the keychain as a string.
- 
getChildKeyChainReturns the child at the given index in the keychain as a keychain.
- 
subchainOverride to give list chance to implement this.
- 
getValueReturns the result of evaluating the given key chain on the given object.
- 
getValueReturns the result of evaluating the given key chain on the given object.
- 
getValueReturns the result of evaluating the given key chain on the given object.
- 
getValueImplReturns the result of evaluating the given key chain on the given object. Broken out so objects can implement custom getKeyChainValue but still have access to default implementation.
- 
getValueListReturns the result of evaluating the given key chain on the given list.
- 
getStringValueConvenience - returns a string for an object and key chain.
- 
getNumberValueConvenience - returns a number for an object and key chain.
- 
getIntValueConvenience - returns an int for an object and key chain.
- 
getFloatValueConvenience - returns a float for an object and key chain.
- 
getDoubleValueConvenience - returns a double for an object and key chain.
- 
getBoolValueConvenience - returns a boolean for an object and key chain.
- 
getListValueConvenience - returns a list for an object and key chain.
- 
getValueReturns a key value if it is of given class (otherwise null).
- 
anyKeyReferencesKeyReturns whether given key is used anywhere in expression. Current version is really hard coded to require key to be isolated (not a part of a key chain).
- 
hasPageReferencepublic boolean hasPageReference()Returns whether given key has a Page/PageMax key reference.
- 
hasOpReturns whether key contains given op.
- 
getErrorReturns the last error encountered by the key chain parser (or null).
- 
getAndResetErrorReturns the last error encountered by the key chain parser and resets parser.
- 
setValueSets the given value for the given key chain + property. This is a real bogus loser implementation.
- 
setValueSets the given value for the given key chain + property. This is a real bogus loser implementation that only supports Op.Key and Op.Chain.
- 
setEnumValueSets the given value for the given key chain + property. This is a real bogus loser implementation.
- 
setValueSafeSets the value but only prints a warning if it fails.
- 
setValueSilentTries to set value in given object, ignoring failure exceptions.
- 
toStringReturns a string representation of the key chain.
- 
addFunctionClassAdds a class to the list of classes that RM queries for functions.
 
-