Class LocalProperties

All Implemented Interfaces:
PropertyHelper.Delegate, PropertyHelper.PropertyEnumerator, PropertyHelper.PropertyEvaluator, PropertyHelper.PropertySetter

Thread local class containing local properties.
Since:
Ant 1.8.0
  • Method Details

    • get

      public static LocalProperties get(Project project)
      Get a localproperties for the given project.
      Parameters:
      project - the project to retrieve the localproperties for.
      Returns:
      the localproperties.
    • initialValue

      protected LocalPropertyStack initialValue()
      Get the initial value.
      Overrides:
      initialValue in class ThreadLocal<LocalPropertyStack>
      Returns:
      a new localproperties stack.
    • addLocal

      public void addLocal(String property)
      Add a local property to the current scope.
      Parameters:
      property - the property name to add.
    • enterScope

      public void enterScope()
      enter the scope
    • exitScope

      public void exitScope()
      exit the scope
    • copy

      public void copy()
      Copy the stack for a parallel thread. To be called from the parallel thread itself.
    • evaluate

      public Object evaluate(String property, PropertyHelper helper)
      Evaluate a property.
      Specified by:
      evaluate in interface PropertyHelper.PropertyEvaluator
      Parameters:
      property - the property's String "identifier".
      helper - the invoking PropertyHelper.
      Returns:
      Object value.
    • setNew

      public boolean setNew(String property, Object value, PropertyHelper propertyHelper)
      Set a *new" property.
      Specified by:
      setNew in interface PropertyHelper.PropertySetter
      Parameters:
      property - the property's String "identifier".
      value - the value to set.
      propertyHelper - the invoking PropertyHelper.
      Returns:
      true if this entity 'owns' the property.
    • set

      public boolean set(String property, Object value, PropertyHelper propertyHelper)
      Set a property.
      Specified by:
      set in interface PropertyHelper.PropertySetter
      Parameters:
      property - the property's String "identifier".
      value - the value to set.
      propertyHelper - the invoking PropertyHelper.
      Returns:
      true if this entity 'owns' the property.
    • getPropertyNames

      public Set<String> getPropertyNames()
      Description copied from interface: PropertyHelper.PropertyEnumerator
      Returns the names of all properties known to this delegate.
      Specified by:
      getPropertyNames in interface PropertyHelper.PropertyEnumerator
      Returns:
      the names of all properties known to this delegate.