org.codehaus.mojo.pomtools.wrapper
Class ListWrapper

java.lang.Object
  extended by org.codehaus.mojo.pomtools.wrapper.modify.AbstractModifiableObject
      extended by org.codehaus.mojo.pomtools.wrapper.ObjectWrapper
          extended by org.codehaus.mojo.pomtools.wrapper.ListWrapper
All Implemented Interfaces:
Iterable, Collection, List, Modifiable
Direct Known Subclasses:
PropertiesWrapper

public class ListWrapper
extends ObjectWrapper
implements List

Version:
$Id: ListWrapper.java 2166 2006-07-18 21:32:16Z carlos $
Author:
David Hawkins

Field Summary
 
Fields inherited from class org.codehaus.mojo.pomtools.wrapper.ObjectWrapper
FIELD_PATH_SEPARATOR
 
Constructor Summary
ListWrapper(ObjectWrapper parent, List items, Class itemClass, Class itemWrapperClass, String name, String itemTypeLabel)
           
ListWrapper(ObjectWrapper parent, List items, Class itemClass, String name, String itemTypeLabel)
           
 
Method Summary
 void add(int arg0, Object arg1)
           
 boolean add(Object arg0)
           
protected  void add(ObjectWrapper o)
           
 boolean addAll(Collection arg0)
           
 boolean addAll(int arg0, Collection arg1)
           
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection arg0)
           
 ObjectWrapper createItem(Object objectToWrap)
           
 boolean equals(Object o)
           
 Object get(int index)
           
 Class getItemClass()
           
 List getItems()
           
 String getItemTypeLabel()
           
 ObjectWrapper getObject(int index)
           
 Object getWrappedObject()
          Returns the original wrapped object with all modifications applied to it.
 int hashCode()
           
 int indexOf(Object o)
           
 boolean isEmpty()
          Iterates through each BeanField and determines if the value is empty.
 Iterator iterator()
           
 int lastIndexOf(Object o)
           
 ListIterator listIterator()
           
 ListIterator listIterator(int index)
           
 Object remove(int index)
           
 boolean remove(Object obj)
           
 boolean removeAll(Collection arg0)
           
 boolean retainAll(Collection arg0)
           
 Object set(int arg0, Object arg1)
           
 int size()
           
 List subList(int fromIndex, int toIndex)
           
 Object[] toArray()
           
 Object[] toArray(Object[] arg0)
           
 String toString()
           
 
Methods inherited from class org.codehaus.mojo.pomtools.wrapper.ObjectWrapper
createDefaultInstance, getFields, getFieldValue, getFieldValue, getFieldValue, getFullName, getInternalWrappedObject, getName, getParent, getValueLabel, isFieldModified, isSameAsDefault, setFieldValue, setFieldValue, setModified, setModified
 
Methods inherited from class org.codehaus.mojo.pomtools.wrapper.modify.AbstractModifiableObject
addChild, isModified, setModified
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListWrapper

public ListWrapper(ObjectWrapper parent,
                   List items,
                   Class itemClass,
                   String name,
                   String itemTypeLabel)

ListWrapper

public ListWrapper(ObjectWrapper parent,
                   List items,
                   Class itemClass,
                   Class itemWrapperClass,
                   String name,
                   String itemTypeLabel)
Method Detail

toString

public String toString()
Overrides:
toString in class ObjectWrapper

getItemTypeLabel

public String getItemTypeLabel()

createItem

public ObjectWrapper createItem(Object objectToWrap)

add

protected void add(ObjectWrapper o)

getWrappedObject

public Object getWrappedObject()
Description copied from class: ObjectWrapper
Returns the original wrapped object with all modifications applied to it. Note that this method will return null if the object is the same as the default constructor for the object.

Overrides:
getWrappedObject in class ObjectWrapper
Returns:
the wrapped object or null is the object isEmpty()

isEmpty

public boolean isEmpty()
Description copied from class: ObjectWrapper
Iterates through each BeanField and determines if the value is empty.

If the value is an instance of ObjectWrapper, the isEmpty() method is called on that object.
If the value is a String, the StringUtils.isNotEmpty(java.lang.String) method is used.
The object is considered to be NOT empty if any field (other than String or ObjectWrapper) is non null.

Specified by:
isEmpty in interface Collection
Specified by:
isEmpty in interface List
Overrides:
isEmpty in class ObjectWrapper

size

public int size()
Specified by:
size in interface Collection
Specified by:
size in interface List

remove

public boolean remove(Object obj)
Specified by:
remove in interface Collection
Specified by:
remove in interface List

getItems

public List getItems()

getItemClass

public Class getItemClass()

getObject

public ObjectWrapper getObject(int index)

get

public Object get(int index)
Specified by:
get in interface List

add

public void add(int arg0,
                Object arg1)
Specified by:
add in interface List

add

public boolean add(Object arg0)
Specified by:
add in interface Collection
Specified by:
add in interface List

addAll

public boolean addAll(Collection arg0)
Specified by:
addAll in interface Collection
Specified by:
addAll in interface List

addAll

public boolean addAll(int arg0,
                      Collection arg1)
Specified by:
addAll in interface List

clear

public void clear()
Specified by:
clear in interface Collection
Specified by:
clear in interface List

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection
Specified by:
contains in interface List

containsAll

public boolean containsAll(Collection arg0)
Specified by:
containsAll in interface Collection
Specified by:
containsAll in interface List

equals

public boolean equals(Object o)
Specified by:
equals in interface Collection
Specified by:
equals in interface List
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection
Specified by:
hashCode in interface List
Overrides:
hashCode in class Object

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List

iterator

public Iterator iterator()
Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection
Specified by:
iterator in interface List

lastIndexOf

public int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List

listIterator

public ListIterator listIterator()
Specified by:
listIterator in interface List

listIterator

public ListIterator listIterator(int index)
Specified by:
listIterator in interface List

remove

public Object remove(int index)
Specified by:
remove in interface List

removeAll

public boolean removeAll(Collection arg0)
Specified by:
removeAll in interface Collection
Specified by:
removeAll in interface List

retainAll

public boolean retainAll(Collection arg0)
Specified by:
retainAll in interface Collection
Specified by:
retainAll in interface List

set

public Object set(int arg0,
                  Object arg1)
Specified by:
set in interface List

subList

public List subList(int fromIndex,
                    int toIndex)
Specified by:
subList in interface List

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection
Specified by:
toArray in interface List

toArray

public Object[] toArray(Object[] arg0)
Specified by:
toArray in interface Collection
Specified by:
toArray in interface List


Copyright © 2011 The Codehaus. All Rights Reserved.