|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.quattor.pan.dml.data.Element
org.quattor.pan.dml.data.PersistentElement
org.quattor.pan.dml.data.Resource
public abstract class Resource
A Resource is a container of Properties and other Resources. All resources descend from PersistentElement which makes them eligible for inclusion in a final machine configuration.
| Nested Class Summary | |
|---|---|
static interface |
Resource.Entry
Interface is an alias to make the syntax for the Resource.Entry less cumbersome. |
static interface |
Resource.Iterator
Interface is simply an alias to make the syntax for the Resource.Iterator less cumbersome. |
| Constructor Summary | |
|---|---|
Resource()
|
|
| Method Summary | |
|---|---|
abstract Element |
get(Term term)
Retrieve the Element associated with the given Term (either an index or string key). |
abstract Resource.Iterator |
iterator()
Get an iterator which allows to run over the resources in the Resource. |
abstract Element |
put(Term term,
Element newValue)
Define the mapping between the given Term and given Element. |
Element |
rget(Term[] terms,
int index,
boolean protect,
boolean lookupOnly)
Dereference the Element to return the value of a child. |
ListResource |
rgetList(Term[] terms,
int index)
This is a special lookup function that will retrieve a list from the resource. |
void |
rput(Term[] terms,
int index,
Element value)
Add the given child to this resource, creating intermediate resources as necessary. |
abstract int |
size()
Get the number of elements in this Resource. |
| Methods inherited from class org.quattor.pan.dml.data.Element |
|---|
checkInvalidSelfContext, checkRange, checkRestrictedContext, checkValidReplacement, defined, duplicate, equals, execute, exists, getTypeAsString, hashCode, isBoolean, isDouble, isList, isLong, isNlist, isPersistent, isProperty, isProtected, isResource, isString, isTransient, locateUndefinedElement, protect, toString, writableCopy |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Resource()
| Method Detail |
|---|
public abstract Element get(Term term)
throws InvalidTermException
term - Term which acts as the key for the desired Element
InvalidTermException - thrown if the term is not of the appropriate type for the
resource; the message should contain the string
representation of the term
public abstract Element put(Term term,
Element newValue)
throws InvalidTermException
term - Term which acts as the key for the desired ElementnewValue - Element to associate with the given Term
InvalidTermException - thrown if the term is not of the appropriate type for the
resource; the message should contain the string
representation of the termpublic abstract int size()
public Element rget(Term[] terms,
int index,
boolean protect,
boolean lookupOnly)
throws InvalidTermException
Element
rget in class Elementterms - list of terms to use for dereferenceindex - the term to use in the given list of termprotect - flag to indicate that the return value should be a protected
(if value is a resource)lookupOnly - indicates that only a lookup is required, return null if the
element doesn't exist
InvalidTermException - thrown if an trying to dereference a list with a key or a
hash with an index
public void rput(Term[] terms,
int index,
Element value)
throws InvalidTermException
Element
rput in class ElementInvalidTermException - thrown if an trying to dereference a list with a key or a
hash with an index
public ListResource rgetList(Term[] terms,
int index)
throws InvalidTermException
Element
rgetList in class Elementterms - list of terms to use for dereferenceindex - the term to use in the given list of term
InvalidTermExceptionpublic abstract Resource.Iterator iterator()
iterator in interface java.lang.Iterable<Resource.Entry>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||