public abstract class TranslatorAdapter
extends java.lang.Object
implements org.eclipse.wst.sse.core.internal.provisional.INodeAdapter
Modifier and Type | Field and Description |
---|---|
protected org.w3c.dom.Element |
node |
protected SSESyncResource |
resource |
Constructor and Description |
---|
TranslatorAdapter(SSESyncResource resource) |
Modifier and Type | Method and Description |
---|---|
protected int |
absoluteIndexOf(org.w3c.dom.Element parentNode,
org.w3c.dom.Element element)
Returns the index of the given element in the list of child elements.
|
protected void |
createWSAfter(org.w3c.dom.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(org.w3c.dom.Element element)
Ensure at least one NL between this node and the previous, and proper start tag indentation.
|
protected void |
formatNode(org.w3c.dom.Element element) |
protected static java.lang.String |
getElementText(org.w3c.dom.Element e)
Returns the textual value of an element.
|
protected org.w3c.dom.Element |
getFirstChildWithName(org.w3c.dom.Element parent,
java.lang.String name)
Returns the first child with the given name, or null if none exists.
|
private java.lang.String |
getIndentBeforeStartTag(org.w3c.dom.Node node) |
private java.lang.String |
getIndentForNode(org.w3c.dom.Element node) |
private java.lang.String |
getNewlineString() |
org.w3c.dom.Element |
getNode() |
protected org.w3c.dom.Element |
getNthChildWithName(org.w3c.dom.Element parent,
java.lang.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(org.w3c.dom.Element parentNode,
org.w3c.dom.Element element)
Returns the index of the given element in the list of elements of the same name.
|
protected void |
removeChildElement(org.w3c.dom.Element e) |
abstract void |
save()
Save the xml value of this adapter from the model.
|
void |
setNode(org.w3c.dom.Element node) |
abstract void |
update(java.lang.Object oldValue,
java.lang.Object newValue,
int index) |
protected SSESyncResource resource
protected org.w3c.dom.Element node
public TranslatorAdapter(SSESyncResource resource)
protected static java.lang.String getElementText(org.w3c.dom.Element e)
e
- public abstract void load()
public abstract void save()
public abstract void update(java.lang.Object oldValue, java.lang.Object newValue, int index)
oldValue
- protected int namedIndexOf(org.w3c.dom.Element parentNode, org.w3c.dom.Element element)
e
- protected int absoluteIndexOf(org.w3c.dom.Element parentNode, org.w3c.dom.Element element)
e
- protected org.w3c.dom.Element getFirstChildWithName(org.w3c.dom.Element parent, java.lang.String name)
name
- protected org.w3c.dom.Element getNthChildWithName(org.w3c.dom.Element parent, java.lang.String name, int n)
name
- n
- public org.w3c.dom.Element getNode()
public void setNode(org.w3c.dom.Element node)
protected void formatNode(org.w3c.dom.Element element)
protected void createWSBefore(org.w3c.dom.Element element)
element
- protected void createWSAfter(org.w3c.dom.Element element)
element
- protected void removeChildElement(org.w3c.dom.Element e)
private java.lang.String getIndentForNode(org.w3c.dom.Element node)
private java.lang.String getIndentBeforeStartTag(org.w3c.dom.Node node)
private java.lang.String getNewlineString()