org.vmguys.vmtools.utils
Class ContentAddOperation

java.lang.Object
  |
  +--org.vmguys.vmtools.utils.AbstractOperation
        |
        +--org.vmguys.vmtools.utils.ContentAddOperation

public class ContentAddOperation
extends AbstractOperation

This class represents an addition to the content of an Element. The content being added can be a String, a Comment, a ProcessingInstruction, a CDATA, or an EntityRef.


Fields inherited from class org.vmguys.vmtools.utils.AbstractOperation
comment, node
 
Constructor Summary
ContentAddOperation(DiffElement node, java.lang.Object content)
          Constructs an operation that will add content to the given node.
ContentAddOperation(DiffElement node, java.lang.Object content, java.lang.String comment)
          Constructs an operation that will add content to the given node.
 
Method Summary
 org.jdom.Element asElement(org.jdom.Namespace namespace)
          Converts the operation to a JDOM Element, possibly with children, that represents the operation.
 int cost()
          Returns a cost associated with this operation.
 int getOperationNodeNumber()
          Returns the number of the node this operation is being applied to.
 java.lang.String getOperationXpath()
          Returns the xpath of the node this operation is being applied to.
 java.lang.String toString()
          Returns a String with information about the operation.
 
Methods inherited from class org.vmguys.vmtools.utils.AbstractOperation
getNodeNumber, getXpath, wrapComment, wrapMetaData, wrapPI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContentAddOperation

public ContentAddOperation(DiffElement node,
                           java.lang.Object content)
Constructs an operation that will add content to the given node. The new content is given.

ContentAddOperation

public ContentAddOperation(DiffElement node,
                           java.lang.Object content,
                           java.lang.String comment)
Constructs an operation that will add content to the given node. The new content is given. The operation will include the specified comment. The comment may be null if it is not needed.
Method Detail

cost

public int cost()
Returns a cost associated with this operation.
Overrides:
cost in class AbstractOperation

asElement

public org.jdom.Element asElement(org.jdom.Namespace namespace)
Converts the operation to a JDOM Element, possibly with children, that represents the operation.
Overrides:
asElement in class AbstractOperation

toString

public java.lang.String toString()
Returns a String with information about the operation.
Overrides:
toString in class AbstractOperation

getOperationXpath

public java.lang.String getOperationXpath()
                                   throws org.jdom.JDOMException
Returns the xpath of the node this operation is being applied to.
Overrides:
getOperationXpath in class AbstractOperation

getOperationNodeNumber

public int getOperationNodeNumber()
Returns the number of the node this operation is being applied to.
Overrides:
getOperationNodeNumber in class AbstractOperation


Copyright © 2001 VM Systems, Inc. All Rights Reserved.