net.sf.morph.reflect
Interface SizableReflector

All Superinterfaces:
net.sf.composite.Component, Reflector
All Known Subinterfaces:
BeanReflector, IndexedContainerReflector, MutableIndexedContainerReflector
All Known Implementing Classes:
ArrayReflector, BaseBeanReflector, BaseServletReflector, CollectionReflector, ContextReflector, DynaBeanReflector, HttpSessionAttributeReflector, ListReflector, MapReflector, ObjectReflector, PageContextAttributeReflector, ResetableIteratorWrapperReflector, ResultSetReflector, ServletContextAttributeReflector, ServletContextInitParameterReflector, ServletRequestAttributeReflector, ServletRequestParameterReflector, ServletRequestReflector, SetReflector, SimpleDelegatingReflector, SortedSetReflector, StringTokenizerReflector, StubbornDelegatingReflector, VelocityContextReflector, VelocityContextReflector

public interface SizableReflector
extends Reflector

A reflector that can tell how many elements are contained in a given object.

Since:
Dec 5, 2004
Author:
Matt Sgarlata

Field Summary
static java.lang.String IMPLICIT_PROPERTY_SIZE
           
 
Method Summary
 int getSize(java.lang.Object object)
          Returns the number of elements contained in a given object.
 
Methods inherited from interface net.sf.morph.reflect.Reflector
getReflectableClasses, getWrapper
 

Field Detail

IMPLICIT_PROPERTY_SIZE

static final java.lang.String IMPLICIT_PROPERTY_SIZE
See Also:
Constant Field Values
Method Detail

getSize

int getSize(java.lang.Object object)
            throws ReflectionException
Returns the number of elements contained in a given object. If the object is a bean, the number of properties is returned. If the object is a container, the number of elements in the container is returned.

Parameters:
object - the object
Returns:
the number of elements contained in the given object
Throws:
ReflectionException - if object is null or the number of elements in the object could not be determined


Copyright © 2004-2008.