org.codehaus.mojo.pomtools.wrapper
Class StringValueWrapper

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.StringValueWrapper
All Implemented Interfaces:
Modifiable

public class StringValueWrapper
extends ObjectWrapper

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

Nested Class Summary
static class StringValueWrapper.StringWrapper
           
 
Field Summary
 
Fields inherited from class org.codehaus.mojo.pomtools.wrapper.ObjectWrapper
FIELD_PATH_SEPARATOR
 
Constructor Summary
StringValueWrapper(ObjectWrapper parent, java.lang.Object value, java.lang.String name, java.lang.Class implClass)
           
 
Method Summary
 java.lang.String getStringValue()
           
 java.lang.Object getWrappedObject()
          Returns the original wrapped object with all modifications applied to it.
 boolean isEmpty()
          Iterates through each BeanField and determines if the value is empty.
 java.lang.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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringValueWrapper

public StringValueWrapper(ObjectWrapper parent,
                          java.lang.Object value,
                          java.lang.String name,
                          java.lang.Class implClass)
Method Detail

getWrappedObject

public java.lang.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.

Overrides:
isEmpty in class ObjectWrapper

toString

public java.lang.String toString()
Overrides:
toString in class ObjectWrapper

getStringValue

public java.lang.String getStringValue()


Copyright © 2009 The Codehaus. All Rights Reserved.