net.sf.mmm.util.pojo.descriptor.base
Class PojoProperty

java.lang.Object
  extended by net.sf.mmm.util.pojo.descriptor.base.PojoProperty

public class PojoProperty
extends Object

This class represents the property of a Pojo .
It can be a simple property such as fooBar, an indexed property such as fooBar[42] or a mapped property such as fooBar['my.key'].
This class contains the logic to parse such property and gives structured access via the offered getters.

Since:
1.1.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Field Summary
private  Integer index
           
private  String key
           
private  String name
           
 
Constructor Summary
PojoProperty(String propertyName)
          The constructor.
 
Method Summary
 Integer getIndex()
          This method gets the optional index.
 String getKey()
          This method gets the optional key.
 String getName()
          This method gets the plain name of the property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

private final String name
See Also:
getName()

index

private final Integer index
See Also:
getIndex()

key

private final String key
See Also:
getKey()
Constructor Detail

PojoProperty

public PojoProperty(String propertyName)
The constructor.

Parameters:
propertyName - is the raw property-name.
Method Detail

getName

public String getName()
This method gets the plain name of the property.
Examples:
propertyName new PojoProperty(propertyName).getName()
fooBar fooBar
foo[42] foo
bar['key'] bar

Returns:
the plain name of the property.

getIndex

public Integer getIndex()
This method gets the optional index.

Returns:
the index or null if this PojoProperty does NOT represent an indexed property.

getKey

public String getKey()
This method gets the optional key.

Returns:
the key of null if this PojoProperty does NOT represent a mapped property.


Copyright © 2001-2010 mmm-Team. All Rights Reserved.