org.apache.tuscany.sdo.util
Class DataObjectUtil.Accessor

java.lang.Object
  extended by 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.


Nested Class Summary
protected static class DataObjectUtil.Accessor.Pool
          Only the get and recycle methods should be call; they are the only synchronized methods.
protected static class DataObjectUtil.Accessor.TokenList
           
 
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
           
 
Constructor Summary
protected DataObjectUtil.Accessor()
           
 
Method Summary
protected  void assertSuccessfulProcess()
           
static DataObjectUtil.Accessor create(org.eclipse.emf.ecore.EObject eObject, String path)
          Creates an accessor for the path of the object.
static DataObjectUtil.Accessor create(org.eclipse.emf.ecore.EObject eObject, String path, Object value)
           
 Object get()
           
 Object getAndRecyle()
           
 org.eclipse.emf.ecore.EObject getEObject()
           
 org.eclipse.emf.ecore.EStructuralFeature getEStructuralFeature()
           
protected  int getIndex()
           
 Property getProperty()
           
protected  void init(org.eclipse.emf.ecore.EObject eObject, String path, Object value)
           
 boolean isSet()
           
 boolean isSetAndRecyle()
           
protected static int matchingIndex(List dataObjects, String attributeName, String attributeValue)
           
protected  void process(String pathString)
           
 void recycle()
           
 void set(Object newValue)
           
 void setAndRecyle(Object newValue)
           
protected  void setEObject(org.eclipse.emf.ecore.EObject eObject)
           
protected  void setFeatureName(String name)
           
protected  void setIndex(int index)
           
 String toString()
           
 void unset()
           
 void unsetAndRecyle()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

DataObjectUtil.Accessor

protected DataObjectUtil.Accessor()
Method Detail

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.