Methods Summary |
---|
public void | appendData(java.lang.String arg)
textRep.appendData(arg);
|
public void | deleteData(int offset, int count)
textRep.deleteData(offset, count);
|
public boolean | equals(java.lang.Object obj)
if ( !( obj instanceof Text ) )
{
return false;
}
return this == obj || hashCode() == obj.hashCode();
|
public java.lang.String | getData()
return textRep.getData();
|
public int | getLength()
return textRep.getLength();
|
public java.lang.String | getNodeValue()Implementation of DOM TEXT Interface
*************************************************************
return textRep.getNodeValue();
|
public int | hashCode()
if ( textRep == null )
{
return -1;
}
return ( textRep.getData() != null ? textRep.getData().hashCode() : 0 );
|
public void | insertData(int offset, java.lang.String arg)
textRep.insertData(offset, arg);
|
public boolean | isComment()Retrieves whether this Text object
represents a comment.
String temp = textRep.getNodeValue().trim();
if(temp.startsWith("<!--") && temp.endsWith("-->"))
return true;
return false;
|
public void | replaceData(int offset, int count, java.lang.String arg)
textRep.replaceData(offset, count, arg);
|
public void | setData(java.lang.String data)
textRep.setData(data);
|
public void | setNodeValue(java.lang.String nodeValue)
setDirty();
textRep.setNodeValue(nodeValue);
|
public org.w3c.dom.Text | splitText(int offset)Use the textRep, and convert it to org.apache.axis.Text
in order to keep the Axis SOAP strcture after operation
This work would be easier if constructor, Text(org.w3c.dom.Text)
is defined
int length = textRep.getLength();
// take the first part, and save the second part for new Text
// length check and exception will be thrown here, no need to duplicated check
String tailData = textRep.substringData(offset,length);
textRep.deleteData(offset,length);
// insert the first part again as a new node
Text tailText = new Text(tailData);
org.w3c.dom.Node myParent = getParentNode();
if(myParent != null){
org.w3c.dom.NodeList brothers = myParent.getChildNodes();
for(int i = 0;i < brothers.getLength(); i++){
if(brothers.item(i).equals(this)){
myParent.insertBefore(tailText, this);
return tailText;
}
}
}
return tailText;
|
public java.lang.String | substringData(int offset, int count)
return textRep.substringData(offset,count);
|
public java.lang.String | toString()
return textRep.getNodeValue();
|