at.ac.tuwien.infosys.sm4all.copal.api.xml
Class InsertAfter

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.xml.InsertAfter
All Implemented Interfaces:
AddStrategy

public class InsertAfter
extends Object
implements AddStrategy

Strategy class for inserting one Element after another Element.

Author:
sanjin

Constructor Summary
InsertAfter(String siblingName, AddStrategy onFailStrategy)
          Creates instance of insert-after AddStrategy that will insert Elements after an Element with specified local name.
 
Method Summary
 void add(Element parent, Element child)
          Inserts specified child Element into specified parent Element after an Element with specified namespace URI and local name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InsertAfter

public InsertAfter(String siblingName,
                   AddStrategy onFailStrategy)
Creates instance of insert-after AddStrategy that will insert Elements after an Element with specified local name. If such Element cannot be found then the specified on-fail AddStrategy is called.

Parameters:
siblingName - the local name of the sibling Element.
onFailStrategy - the on-fail AddStrategy.
Throws:
NullPointerException - if specified sibling name or on-fail AddStrategy is null.
IllegalArgumentException - if specified sibling name is an empty or blank string.
Method Detail

add

public void add(Element parent,
                Element child)
Inserts specified child Element into specified parent Element after an Element with specified namespace URI and local name. If such Element cannot be found then the specified on-fail AddStrategy is called.

Specified by:
add in interface AddStrategy
Parameters:
parent - the parent Element.
child - the child Element.
Throws:
NullPointerException - if parent or child Element is null.


Copyright © 2010 Distributed Systems Group, Vienna University of Technology. All Rights Reserved.