public class PropertySet extends DataType implements ResourceCollection
Modifier and Type | Class and Description |
---|---|
static class |
PropertySet.BuiltinPropertySetName
Used for propertyref's builtin attribute.
|
static class |
PropertySet.PropertyRef
This is a nested class containing a reference to some properties
and optionally a source of properties.
|
description, location, project
Constructor and Description |
---|
PropertySet() |
Modifier and Type | Method and Description |
---|---|
void |
add(FileNameMapper fileNameMapper)
Add a nested FileNameMapper.
|
void |
addPropertyref(PropertySet.PropertyRef ref)
Add a property reference (nested element) to the references to be used.
|
void |
addPropertyset(PropertySet ref)
Add another property set to this set.
|
void |
appendBuiltin(PropertySet.BuiltinPropertySetName b)
Allow builtin (all, system or commandline) properties in the set.
|
void |
appendName(java.lang.String name)
Allow properties of a particular name in the set.
|
void |
appendPrefix(java.lang.String prefix)
Allow properties whose names start with a prefix in the set.
|
void |
appendRegex(java.lang.String regex)
Allow properties whose names match a regex in the set.
|
protected void |
assertNotReference()
Ensures this data type is not a reference.
|
Mapper |
createMapper()
Create a mapper to map the property names.
|
protected void |
dieOnCircularReference(java.util.Stack stk,
Project p)
Check to see whether any DataType we hold references to is
included in the Stack (which holds all DataType instances that
directly or indirectly reference this instance, including this
instance itself).
|
boolean |
getDynamic()
Get the dynamic attribute.
|
Mapper |
getMapper()
Get the mapper attribute.
|
java.util.Properties |
getProperties()
This is the operation to get the existing or recalculated properties.
|
protected PropertySet |
getRef()
Performs the check for circular references and returns the
referenced PropertySet.
|
boolean |
isFilesystemOnly()
Fulfill the ResourceCollection contract.
|
java.util.Iterator |
iterator()
Fulfill the ResourceCollection interface.
|
void |
setDynamic(boolean dynamic)
Set whether to reevaluate the set everytime the set is used.
|
void |
setMapper(java.lang.String type,
java.lang.String from,
java.lang.String to)
Set a mapper to change property names.
|
void |
setNegate(boolean negate)
Set whether to negate results.
|
void |
setRefid(Reference r)
Sets the value of the refid attribute.
|
int |
size()
Fulfill the ResourceCollection contract.
|
java.lang.String |
toString()
A debug toString.
|
checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributes
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
public void appendName(java.lang.String name)
name
- the property name to allow.public void appendRegex(java.lang.String regex)
regex
- the regular expression to use.public void appendPrefix(java.lang.String prefix)
prefix
- the prefix to use.public void appendBuiltin(PropertySet.BuiltinPropertySetName b)
b
- the type of builtin properties.public void setMapper(java.lang.String type, java.lang.String from, java.lang.String to)
type
- mapper type.from
- source pattern.to
- output pattern.public void addPropertyref(PropertySet.PropertyRef ref)
ref
- a property reference.public void addPropertyset(PropertySet ref)
ref
- another property set.public Mapper createMapper()
public void add(FileNameMapper fileNameMapper)
fileNameMapper
- the mapper to add.public void setDynamic(boolean dynamic)
dynamic
- if true, reevaluate the property set each time
the set is used. if false cache the property set
the first time and use the cached set on subsequent
occasions.public void setNegate(boolean negate)
negate
- if true, negate the selection criteria.public boolean getDynamic()
public Mapper getMapper()
public java.util.Properties getProperties()
protected PropertySet getRef()
public final void setRefid(Reference r)
setRefid
in class DataType
r
- the reference this datatype should point to.BuildException
- if another attribute was set, since
refid and all other attributes are mutually exclusive.protected final void assertNotReference()
Calling this method as the first line of every bean method of this data type (setXyz, addXyz, createXyz) ensure proper handling of the refid attribute.
BuildException
- if the refid attribute was already set, since
refid and all other attributes are mutually exclusive.public java.lang.String toString()
public java.util.Iterator iterator()
iterator
in interface ResourceCollection
public int size()
size
in interface ResourceCollection
public boolean isFilesystemOnly()
isFilesystemOnly
in interface ResourceCollection
protected void dieOnCircularReference(java.util.Stack stk, Project p) throws BuildException
DataType
If one is included, throw a BuildException created by circularReference
.
This implementation is appropriate only for a DataType that cannot hold other DataTypes as children.
The general contract of this method is that it shouldn't do
anything if
is true and
set it to true on exit.checked
dieOnCircularReference
in class DataType
stk
- the stack of references to check.p
- the project to use to dereference the references.BuildException
- on error.