Class Property

  • All Implemented Interfaces:
    java.io.Serializable, Condition

    public class Property
    extends java.lang.Object
    Information about how to initialize a property (a.k.a., a field of a component). There are two kind of properties: one is a String instance (either a string value or an expression), and the other is a NativeInfo instance. The later is also called the native content.
    Author:
    tomyeh
    See Also:
    Serialized Form
    • Constructor Detail

      • Property

        public Property​(EvaluatorRef evalr,
                        java.lang.String name,
                        java.lang.String value,
                        ConditionImpl cond)
        Constructs a property with a class that is known in advance.
        Throws:
        java.lang.IllegalArgumentException - if name is null
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns the name of the property.
      • getRawValue

        public java.lang.String getRawValue()
        Returns the raw value of the property. Note: it is the original value without evaluation. In other words, it may contain EL expressions.
        Throws:
        java.lang.UnsupportedOperationException - if value is the native content, i.e., it is constructed by use of Property(EvaluatorRef, String, NativeInfo, ConditionImpl).
        Since:
        3.0.0
      • isNativeInfo

        public boolean isNativeInfo()
        Returns whether the property is held by NativeInfo.
        Returns:
        Since:
        10.0.0
      • setRawValue

        public void setRawValue​(java.lang.String value)
        Sets the raw value of the property.
        Throws:
        java.lang.UnsupportedOperationException - if value is the native content, i.e., it is constructed by use of Property(EvaluatorRef, String, NativeInfo, ConditionImpl).
        Since:
        3.0.0
      • assign

        public static final void assign​(Component comp,
                                        java.lang.String name,
                                        java.lang.String value)
        Assigns a property.

        Don't use the reflection directly since this method searches more signatures.

        Throws:
        PropertyNotFoundException - if the property is not found, i.e., no corresponding method and DynamicPropertied not implemented.
        UiException - if fail to assign
        Since:
        3.5.0
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getEvaluatorRef

        public EvaluatorRef getEvaluatorRef()
        Returns the evaluator reference.
      • getCondition

        public ConditionImpl getCondition()
        Returns the effectiveness condition.
      • setCondition

        public void setCondition​(ConditionImpl cond)
        Sets the effectiveness condition.
      • withCondition

        public boolean withCondition()
        Tests if the condition is set
      • isEffective

        public boolean isEffective​(Component comp)
        Description copied from interface: Condition
        Used to evaluate whether it is effective.
        Specified by:
        isEffective in interface Condition
        Parameters:
        comp - used as the self variable. Ignored if null.
      • isEffective

        public boolean isEffective​(Page page)
        Description copied from interface: Condition
        Used to evaluate whether it is effective.
        Specified by:
        isEffective in interface Condition
        Parameters:
        page - used as the self variable. Ignored if null.