@Immutable public abstract class Element extends Object implements Operation
| Type | Property and Description |
|---|---|
boolean |
is
Determine if the given Element is a Property.
|
| Constructor and Description |
|---|
Element() |
| Modifier and Type | Method and Description |
|---|---|
void |
checkInvalidSelfContext()
The default implementation does nothing.
|
void |
checkRange(Range range)
Determine if the element satisfies the given range constraint.
|
void |
checkRestrictedContext()
The default implementation does nothing.
|
void |
checkValidReplacement(Element newValue)
Check that the newValue is a valid replacement for the this value.
|
boolean |
defined()
Determine if the given Element is defined.
|
Element |
duplicate()
This method does a "clone" of the given Element.
|
abstract boolean |
equals(Object o)
Require that all Elements implement an equals method.
|
Element |
execute(Context context)
All Elements are Operations and can be executed, but each just returns a
reference to itself.
|
boolean |
exists()
Returns true for all Element objects except Null.
|
abstract String |
getTypeAsString()
All Elements must return a string describing its type.
|
abstract int |
hashCode()
Require that all Elements implement the hashCode method.
|
boolean |
isBoolean()
Determine if the given Element is a Boolean.
|
boolean |
isDouble()
Determine if the given Element is a Double.
|
boolean |
isList()
Determine if the given Element is a List.
|
boolean |
isLong()
Determine if the given Element is a Long.
|
boolean |
isNlist()
Determine if the given Element is an Nlist.
|
boolean |
isPersistent()
Determine if the given Element is Persistent.
|
boolean |
isProperty()
Determine if the given Element is a Property.
|
boolean |
isProtected()
This method indicates if the given Element is protected.
|
boolean |
isResource()
Determine if the given Element is a Resource.
|
boolean |
isString()
Determine if the given Element is a String.
|
boolean |
isTransient()
Determine if the given Element is Transient.
|
String |
locateUndefinedElement()
Determine if the element contains any undefined (transient) elements.
|
Element |
protect()
Return a protected version of this 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 String |
toString()
Require that all Elements implement a reasonable toString method.
|
Element |
writableCopy()
This method returns a writable copy of this Element.
|
public boolean exists()
public boolean defined()
public boolean isProperty()
public boolean isLong()
public boolean isDouble()
public boolean isBoolean()
public boolean isString()
public boolean isResource()
public boolean isNlist()
public boolean isList()
public boolean isPersistent()
public boolean isTransient()
public String locateUndefinedElement()
public void checkRange(Range range) throws ValidationException
range - Range to check Element againstValidationException - if the element cannot be compared to a range or if the
element doesn't meet the range requirementpublic Element execute(Context context) throws EvaluationException
execute in interface Operationcontext - evaluation context for the statementEvaluationException - if an error occurs during processingpublic Element duplicate()
public Element writableCopy()
public void checkRestrictedContext()
throws SyntaxException
checkRestrictedContext in interface OperationSyntaxException - if this operation cannot be run within a restricted contextpublic void checkInvalidSelfContext()
throws SyntaxException
checkInvalidSelfContext in interface OperationSyntaxException - if this operation references SELFpublic boolean isProtected()
public void checkValidReplacement(Element newValue) throws EvaluationException
newValue - the new value for the replacementEvaluationException - if the new value is not a valid replacement of the existing
valuepublic Element protect()
public Element rget(Term[] terms, int index, boolean protect, boolean lookupOnly) throws InvalidTermException
terms - 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 existInvalidTermException - thrown if an trying to dereference a list with a key or a
hash with an indexpublic ListResource rgetList(Term[] terms, int index) throws InvalidTermException
terms - list of terms to use for dereferenceindex - the term to use in the given list of termInvalidTermExceptionpublic void rput(Term[] terms, int index, Element value) throws InvalidTermException
InvalidTermException - thrown if an trying to dereference a list with a key or a
hash with an indexpublic abstract String getTypeAsString()
public abstract String toString()
public abstract int hashCode()
Copyright © 2014 Quattor. All Rights Reserved.