站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 5.0.0

PropertyEvaluator (NetBeans Ant Project API) - NetBeans API Javadoc 5.0.0

 

org.netbeans.spi.project.support.ant
Interface PropertyEvaluator


public interface PropertyEvaluator

A way of mapping property names to values.

This interface defines no independent thread safety, but in typical usage it will be used with the project manager mutex. Changes should be fired synchronously.

See Also:
PropertyUtils.sequentialPropertyEvaluator(org.netbeans.spi.project.support.ant.PropertyProvider, org.netbeans.spi.project.support.ant.PropertyProvider[]), AntProjectHelper.getStandardPropertyEvaluator()

Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Add a listener to changes in particular property values.
 String evaluate(String text)
          Evaluate a block of text possibly containing property references.
 Map getProperties()
          Get a set of all current property definitions at once.
 String getProperty(String prop)
          Evaluate a single property.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Remove a listener to changes in particular property values.
 

Method Detail

getProperty

public String getProperty(String prop)
Evaluate a single property.

Parameters:
prop - the name of a property
Returns:
its value, or null if it is not defined or its value could not be retrieved for some reason (e.g. a circular definition)

evaluate

public String evaluate(String text)
Evaluate a block of text possibly containing property references. The syntax is the same as for Ant: ${foo} means the value of the property foo; $$ is an escape for $; references to undefined properties are left unsubstituted.

Parameters:
text - some text possibly containing one or more property references
Returns:
its value, or null if some problem (such a circular definition) made it impossible to retrieve the values of some properties

getProperties

public Map getProperties()
Get a set of all current property definitions at once. This may be more efficient than evaluating individual properties, depending on the implementation.

Returns:
an immutable map from property names to values, or null if the mapping could not be computed (e.g. due to a circular definition)

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Add a listener to changes in particular property values. As generally true with property change listeners, the old and new values may both be null in case the true values are not known or not easily computed; and the property name might be null to signal that any property might have changed.

Parameters:
listener - a listener to add

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Remove a listener to changes in particular property values.

Parameters:
listener - a listener to remove

 

Built on May 3 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.