|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.drjava.config.DrJavaProperty
public abstract class DrJavaProperty
Class representing values that can be inserted as variables in external processes.
| Nested Class Summary | |
|---|---|
static class |
DrJavaProperty.InfiniteLoopException
Exception thrown if an infinite loop of invalidation listening is detected. |
| Field Summary | |
|---|---|
protected HashMap<String,String> |
_attributes
Map of attributes. |
protected String |
_help
Help page for this property. |
protected boolean |
_isCurrent
Is the value current? |
protected Set<DrJavaProperty> |
_listening
Set of other properties that are listening to this property, i.e. |
protected String |
_name
Name of the property. |
protected String |
_value
Value of the property. |
boolean |
DEACTIVATED_DUE_TO_ERROR
Whether the invalidation listening mechanism has been deactivated due to an error. |
| Constructor Summary | |
|---|---|
DrJavaProperty(String name,
String help)
Create a property. |
|
DrJavaProperty(String name,
String value,
String help)
Create a property. |
|
| Method Summary | |
|---|---|
protected void |
_invalidate()
Just invalidate. |
boolean |
equals(Object other)
|
String |
getAttribute(String key)
Return an attribute's value. |
String |
getCurrent(PropertyMaps pm)
Return the value of the property. |
String |
getHelp()
Return the value, which might be stale. |
String |
getLazy(PropertyMaps pm)
Return the value of the property lazily. |
String |
getName()
Return the name of the property. |
int |
hashCode()
|
void |
invalidate()
Mark the value as stale and invalidate other properties that are listening. |
protected void |
invalidateOthers(Set<DrJavaProperty> alreadyVisited)
Invalidate those properties that are listening to this property. |
boolean |
isCurrent()
Return true if the value is current. |
DrJavaProperty |
listenToInvalidatesOf(DrJavaProperty other)
|
void |
resetAttributes()
Reset attributes to their defaults. |
void |
setAttribute(String key,
String value)
Set an attribute's value. |
void |
setAttributes(HashMap<String,String> attrs,
Lambda<String,String> replaceLambda)
Set all attribute values. |
String |
toString()
Return the value, which might be stale or null. |
abstract void |
update(PropertyMaps pm)
Update the property so the value is current. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public volatile boolean DEACTIVATED_DUE_TO_ERROR
protected String _name
protected String _value
protected boolean _isCurrent
protected String _help
protected HashMap<String,String> _attributes
protected Set<DrJavaProperty> _listening
| Constructor Detail |
|---|
public DrJavaProperty(String name,
String help)
public DrJavaProperty(String name,
String value,
String help)
| Method Detail |
|---|
public String getName()
public String getCurrent(PropertyMaps pm)
pm - PropertyMaps used for substitution when replacing variablespublic String getLazy(PropertyMaps pm)
pm - PropertyMaps used for substitution when replacing variablespublic abstract void update(PropertyMaps pm)
pm - PropertyMaps used for substitution when replacing variablespublic void resetAttributes()
public void setAttribute(String key,
String value)
key - name of the attributevalue - new value of the attribute
IllegalArgumentException - if attribute with specified key does not already exist in table
public void setAttributes(HashMap<String,String> attrs,
Lambda<String,String> replaceLambda)
attrs - attribute key-value pairsreplaceLambda - lambda that can be used to replace the variables in a value
IllegalArgumentException - if an attribute with a specified key does not already exist in tablepublic String getAttribute(String key)
key - name of the attribute
IllegalArgumentException - if attribute with specified key does not already exist in tablepublic String toString()
toString in class Objectpublic String getHelp()
public boolean isCurrent()
public void invalidate()
protected void _invalidate()
public DrJavaProperty listenToInvalidatesOf(DrJavaProperty other)
public boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Objectprotected void invalidateOthers(Set<DrJavaProperty> alreadyVisited)
alreadyVisited - set of properties already visited, to avoid cycles.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||