java.lang.Object
com.inductiveautomation.perspective.common.api.PropertyRef

public class PropertyRef extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static 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 the PropertyRef 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 Type
    Method
    Description
    static boolean
    isParseable(String propertyReference)
    Verifies the reference path matches the required syntax for successful parsing.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • NAME

      public static final Pattern NAME
      Pattern representing a legal component name in a Property Reference path, such as a Container or Component name. Enforced by ComponentPropsDocumentModel and PerspectiveKeyEditor
    • IDENTIFIER

      public static final 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
      Invalid Examples:
      • 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

      public static final Pattern ABSOLUTE
      Pattern which checks for the validity of a an absolute path.
    • RELATIVE

      public static final 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 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 Details

    • isParseable

      public static boolean isParseable(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