net.sf.mmm.util.pojo.descriptor.impl.accessor
Class PojoPropertyAccessorProxyGetByIndex
java.lang.Object
net.sf.mmm.util.pojo.descriptor.base.accessor.AbstractPojoPropertyAccessor
net.sf.mmm.util.pojo.descriptor.base.accessor.AbstractPojoPropertyAccessorProxy
net.sf.mmm.util.pojo.descriptor.impl.accessor.PojoPropertyAccessorProxyGetByIndex
- All Implemented Interfaces:
- PojoPropertyAccessor, PojoPropertyAccessorNonArg, PojoAttributeName
public class PojoPropertyAccessorProxyGetByIndex
- extends AbstractPojoPropertyAccessorProxy
- implements PojoPropertyAccessorNonArg
This is an implementation of the PojoPropertyAccessorNonArg acting as
as a getter that
delegates to a
indexed-getter using a fixed index.
- Since:
- 1.1.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
delegate
private final PojoPropertyAccessorIndexedNonArg delegate
- See Also:
getDelegate()
index
private final int index
- See Also:
invoke(Object)
PojoPropertyAccessorProxyGetByIndex
public PojoPropertyAccessorProxyGetByIndex(PojoPropertyAccessorIndexedNonArg delegate,
int index)
- The constructor.
- Parameters:
delegate - is the delegate.index - is the index to use.
getMode
public PojoPropertyAccessorNonArgMode getMode()
- This method gets the mode of this accessor.
- Specified by:
getMode in interface PojoPropertyAccessor- Specified by:
getMode in interface PojoPropertyAccessorNonArg- Overrides:
getMode in class AbstractPojoPropertyAccessorProxy
- Returns:
- the access mode.
getDelegate
protected PojoPropertyAccessorIndexedNonArg getDelegate()
- This method gets the
accessor this proxy
delegates to.
- Specified by:
getDelegate in class AbstractPojoPropertyAccessorProxy
- Returns:
- the delegate.
invoke
public Object invoke(Object pojoInstance)
throws ReflectionException
- This method invokes the according property-method of
pojoInstance with the given arguments.
- Specified by:
invoke in interface PojoPropertyAccessorNonArg
- Parameters:
pojoInstance - is the instance of the POJO where to access the
property. Has to be an instance of the
type from where this accessor was created for.
- Returns:
- the result of the invocation. It will be
null if void
(e.g. initialize method). For a regular getter this will be the
value of the property.
- Throws:
ReflectionException - if the underlying
accessor caused
an error during reflection.
Copyright © 2001-2010 mmm-Team. All Rights Reserved.