Class PropertyRef
java.lang.Object
com.inductiveautomation.perspective.common.api.PropertyRef
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PatternPattern which checks for the validity of a an absolute path.static final PatternPattern which matches the validity of a Property Identifier as defined in the thePropertyRefdocumentation.static final PatternPattern representing a legal component name in a Property Reference path, such as a Container or Component name.static final PatternPattern 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 final PatternPattern checks on the validity of a Property Reference which uses one of the shortcut prefixes such as this , view, or parent. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisParseable(String propertyReference) Verifies the reference path matches the required syntax for successful parsing.
-
Field Details
-
NAME
Pattern representing a legal component name in a Property Reference path, such as a Container or Component name. Enforced byComponentPropsDocumentModelandPerspectiveKeyEditor -
IDENTIFIER
Pattern which matches the validity of a Property Identifier as defined in the thePropertyRefdocumentation.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 scope -
this/childComp.meta.name
-- ERROR: separator in shortcut -
parent/childComp.meta.name
-- ERROR: separator in shortcut -
2comp.meta.name
-- ERROR: component name begins with number -
comp.custom.2ndIndex
-- ERROR: property begins with number
-
-
ABSOLUTE
Pattern which checks for the validity of a an absolute path. -
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
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, sothis/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 Details
-
isParseable
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
-