public abstract class TranslatorAdapter extends Object implements org.eclipse.wst.sse.core.internal.provisional.INodeAdapter
Modifier and Type | Field and Description |
---|---|
protected Element |
node |
protected SSESyncResource |
resource |
Constructor and Description |
---|
TranslatorAdapter(SSESyncResource resource) |
Modifier and Type | Method and Description |
---|---|
protected int |
absoluteIndexOf(Element parentNode,
Element element)
Returns the index of the given element in the list of child elements.
|
protected void |
createWSAfter(Element element)
Ensure at least one NL between this node and the next, and proper indent to the next tag tag indentation.
|
protected void |
createWSBefore(Element element)
Ensure at least one NL between this node and the previous, and proper start tag indentation.
|
protected void |
formatNode(Element element) |
protected static String |
getElementText(Element e)
Returns the textual value of an element.
|
protected Element |
getFirstChildWithName(Element parent,
String name)
Returns the first child with the given name, or null if none exists.
|
Element |
getNode() |
protected Element |
getNthChildWithName(Element parent,
String name,
int n)
Returns the nth child element with a given name, or null if no such element exists.
|
abstract void |
load()
Load the model value from this adapter's xml value
|
protected int |
namedIndexOf(Element parentNode,
Element element)
Returns the index of the given element in the list of elements of the same name.
|
protected void |
removeChildElement(Element e) |
abstract void |
save()
Save the xml value of this adapter from the model.
|
void |
setNode(Element node) |
abstract void |
update(Object oldValue,
Object newValue,
int index) |
protected SSESyncResource resource
protected Element node
public TranslatorAdapter(SSESyncResource resource)
protected static String getElementText(Element e)
e
- public abstract void load()
public abstract void save()
public abstract void update(Object oldValue, Object newValue, int index)
oldValue
- protected int namedIndexOf(Element parentNode, Element element)
e
- protected int absoluteIndexOf(Element parentNode, Element element)
e
- protected Element getFirstChildWithName(Element parent, String name)
name
- protected Element getNthChildWithName(Element parent, String name, int n)
name
- n
- public Element getNode()
public void setNode(Element node)
protected void formatNode(Element element)
protected void createWSBefore(Element element)
element
- protected void createWSAfter(Element element)
element
- protected void removeChildElement(Element e)
Copyright © 2005–2015 Sonatype, Inc.. All rights reserved.