org.apache.tuscany.sdo.util
Class DataObjectUtil.Accessor
java.lang.Object
org.apache.tuscany.sdo.util.DataObjectUtil.Accessor
- Enclosing class:
- DataObjectUtil
public static final class DataObjectUtil.Accessor
- extends Object
Process the default EMF path and minimal XPath syntax.
This design is still under review and construction.
Syntax:
path = /? (step '/')* step
step = feature
| feature '.' index_from_0
| feature '[' index_from_1 ']'
| reference '[' attribute '=' value ']'
| ..
| '@' step
feature = the name of an attribute or reference
attribute = the name of an attribute
reference = the name of a reference
index = positive integer
value = the string value of an attribute
leading / begins at the root
.. is containing object
features must be multi-valued to use '.' and '[' operations.
Only the last step may have an attribute as the feature.
Field Summary |
protected org.eclipse.emf.ecore.EObject |
eObject
|
protected org.eclipse.emf.ecore.EStructuralFeature |
feature
|
protected int |
index
|
protected static int |
NO_INDEX
|
protected Object |
value
|
NO_INDEX
protected static final int NO_INDEX
- See Also:
- Constant Field Values
eObject
protected org.eclipse.emf.ecore.EObject eObject
value
protected Object value
feature
protected org.eclipse.emf.ecore.EStructuralFeature feature
index
protected int index
DataObjectUtil.Accessor
protected DataObjectUtil.Accessor()
create
public static DataObjectUtil.Accessor create(org.eclipse.emf.ecore.EObject eObject,
String path)
- Creates an accessor for the path of the object.
create
public static DataObjectUtil.Accessor create(org.eclipse.emf.ecore.EObject eObject,
String path,
Object value)
init
protected void init(org.eclipse.emf.ecore.EObject eObject,
String path,
Object value)
get
public Object get()
getAndRecyle
public Object getAndRecyle()
assertSuccessfulProcess
protected final void assertSuccessfulProcess()
set
public void set(Object newValue)
setAndRecyle
public void setAndRecyle(Object newValue)
isSet
public boolean isSet()
isSetAndRecyle
public boolean isSetAndRecyle()
unset
public void unset()
unsetAndRecyle
public void unsetAndRecyle()
recycle
public void recycle()
getEObject
public org.eclipse.emf.ecore.EObject getEObject()
setEObject
protected void setEObject(org.eclipse.emf.ecore.EObject eObject)
getEStructuralFeature
public org.eclipse.emf.ecore.EStructuralFeature getEStructuralFeature()
getProperty
public Property getProperty()
setFeatureName
protected void setFeatureName(String name)
getIndex
protected int getIndex()
setIndex
protected void setIndex(int index)
process
protected void process(String pathString)
matchingIndex
protected static int matchingIndex(List dataObjects,
String attributeName,
String attributeValue)
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2013 The Apache Software Foundation. All Rights Reserved.