|
org.netbeans.modules.project.ant/1 1.12.22 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.netbeans.spi.project.support.ant.PropertyUtils
public class PropertyUtils
Support for working with Ant properties and property files.
Method Summary | |
---|---|
static PropertyProvider |
fixedPropertyProvider(Map defs)
Create a trivial property producer using only a fixed list of property definitions. |
static EditableProperties |
getGlobalProperties()
Load global properties defined by the IDE in the user directory. |
static String |
getUsablePropertyName(String name)
Returns name usable as Ant property which is based on the given name. |
static PropertyProvider |
globalPropertyProvider()
Create a property evaluator based on getGlobalProperties()
and putGlobalProperties(org.netbeans.spi.project.support.ant.EditableProperties) . |
static boolean |
isUsablePropertyName(String name)
Checks whether the name is usable as Ant property name. |
static PropertyProvider |
propertiesFilePropertyProvider(File propertiesFile)
Create a property provider based on a properties file. |
static void |
putGlobalProperties(EditableProperties properties)
Edit global properties defined by the IDE in the user directory. |
static String |
relativizeFile(File basedir,
File file)
Produce a machine-independent relativized version of a filename from a basedir. |
static File |
resolveFile(File basedir,
String filename)
Find an absolute file path from a possibly relative path. |
static PropertyEvaluator |
sequentialPropertyEvaluator(PropertyProvider preprovider,
PropertyProvider[] providers)
Create a property evaluator based on a series of definitions. |
static String[] |
tokenizePath(String path)
Split an Ant-style path specification into components. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static EditableProperties getGlobalProperties()
Acquires read access.
To listen to changes use globalPropertyProvider()
.
public static void putGlobalProperties(EditableProperties properties) throws IOException
Acquires write access.
properties
- user properties to set
IOException
- if they could not be storedgetGlobalProperties()
public static PropertyProvider globalPropertyProvider()
getGlobalProperties()
and putGlobalProperties(org.netbeans.spi.project.support.ant.EditableProperties)
.
It will supply global properties and fire changes when this file
is changed.
public static PropertyProvider propertiesFilePropertyProvider(File propertiesFile)
propertiesFile
- a path to a (possibly nonexistent) *.properties file
Properties.load(java.io.InputStream)
public static File resolveFile(File basedir, String filename) throws IllegalArgumentException
basedir
- base file for relative filename resolving; must be an absolute pathfilename
- a pathname which may be relative or absolute and may
use / or \ as the path separator
IllegalArgumentException
- if basedir is not absolutepublic static String relativizeFile(File basedir, File file)
URI.relativize(java.net.URI)
this will produce "../" sequences as needed.
basedir
- a directory to resolve relative to (need not exist on disk)file
- a file or directory to find a relative path for
IllegalArgumentException
- if the basedir is known to be a file and not a directorypublic static String[] tokenizePath(String path)
:
and ;
, paying
attention to DOS-style components such as C:\FOO.
Also removes any empty components.
path
- an Ant-style path (elements arbitrary) using DOS or Unix separators
public static boolean isUsablePropertyName(String name)
name
- name to check for usability as Ant property
public static String getUsablePropertyName(String name)
name
- name to use as base for Ant property name
public static PropertyProvider fixedPropertyProvider(Map defs)
defs
- a map from property names to values (it is illegal to modify this map
after passing it to this method)
public static PropertyEvaluator sequentialPropertyEvaluator(PropertyProvider preprovider, PropertyProvider[] providers)
Each batch of definitions can refer to properties within itself (so long as there is no cycle) or any previous batch. However the special first provider cannot refer to properties within itself.
This implementation acquires ProjectManager.mutex()
for all operations, in read mode,
and fires changes synchronously. It also expects changes to be fired from property
providers in read (or write) access.
preprovider
- an initial context (may be null)providers
- a sequential list of property groups
|
org.netbeans.modules.project.ant/1 1.12.22 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |