Class PropertyRef
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Pattern
Pattern which checks for the validity of a an absolute path.static final Pattern
Pattern which matches the validity of a Property Identifier as defined in the thePropertyRef
documentation.static final Pattern
Pattern representing a legal component name in a Property Reference path, such as a Container or Component name.static final Pattern
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 final Pattern
Pattern 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 boolean
isParseable
(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 byComponentPropsDocumentModel
andPerspectiveKeyEditor
-
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
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, 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 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
-