Class PropertyRef
- java.lang.Object
-
- com.inductiveautomation.perspective.common.api.PropertyRef
-
public class PropertyRef extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.regex.Pattern
ABSOLUTE
Pattern which checks for the validity of a an absolute path.static java.util.regex.Pattern
IDENTIFIER
Pattern which matches the validity of a Property Identifier as defined in the thePropertyRef
documentation.static java.util.regex.Pattern
NAME
Pattern representing a legal component name in a Property Reference path, such as a Container or Component name.static java.util.regex.Pattern
RELATIVE
Pattern to check that a property reference path is a 'Relative' reference, meaning it follows a linux-like relative path style such as ../peerComponentName.props.text, or ./childComonentName/deeperChild.custom.customProp1.static java.util.regex.Pattern
SHORTCUT
Pattern checks on the validity of a Property Reference which uses one of the shortcut prefixes such as this , view, or parent.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isParseable(java.lang.String propertyReference)
Verifies the reference path matches the required syntax for successful parsing.
-
-
-
Field Detail
-
NAME
public static final java.util.regex.Pattern NAME
Pattern representing a legal component name in a Property Reference path, such as a Container or Component name. Enforced byComponentPropsDocumentModel
andPerspectiveKeyEditor
-
IDENTIFIER
public static final java.util.regex.Pattern IDENTIFIER
Pattern which matches the validity of a Property Identifier as defined in the the
PropertyRef
documentation.Valid Examples:
this.props.value
this.custom.styleTree.size
parent.meta.name
aComponent.meta.name
DifferentComponent.meta.visible
_comp.meta.visible
_comp2.custom._aTree.textEntry1
this.value
-- ERROR: missing property scopethis/childComp.meta.name
-- ERROR: separator in shortcutparent/childComp.meta.name
-- ERROR: separator in shortcut2comp.meta.name
-- ERROR: component name begins with numbercomp.custom.2ndIndex
-- ERROR: property begins with number
-
ABSOLUTE
public static final java.util.regex.Pattern ABSOLUTE
Pattern which checks for the validity of a an absolute path.
-
RELATIVE
public static final java.util.regex.Pattern RELATIVE
Pattern to check that a property reference path is a 'Relative' reference, meaning it follows a linux-like relative path style such as ../peerComponentName.props.text, or ./childComonentName/deeperChild.custom.customProp1. Note that path separators can be used in relative references and as such should be used when needing to resolve deeper structures.
Valid examples:../peerComponent.props.value
./childComponent.props.value
../../peerToParent.meta.name
.../peerToParent.meta.name
-
SHORTCUT
public static final java.util.regex.Pattern SHORTCUT
Pattern checks on the validity of a Property Reference which uses one of the shortcut prefixes such as this , view, or parent. These shortcuts provide a convenient alternative for targeting properties within component, a component's parent, or the parent view. Path separators ("/") are not valid in shortcut references, so
this/child.props.value
is not valid. If one needs to reference a child component, then a relative reference such as./childComponent/aDeeperChild.props.value
would be appropriate.
-
-
Method Detail
-
isParseable
public static boolean isParseable(java.lang.String propertyReference)
Verifies the reference path matches the required syntax for successful parsing. Does not validate the location of any named items or properties in the path.- Parameters:
propertyReference
- a string representing a path to a valid property identifier.- Returns:
- true if the provided string is formatted to be parsed as a PropertyReference
-
-