org.apache.felix.ipojo.parser
Class FieldMetadata

java.lang.Object
  extended by org.apache.felix.ipojo.parser.FieldMetadata

public class FieldMetadata
extends Object

A Field Metadata represents a field of the implementation class. This class avoids using reflection to get the type and the name of a field.

Author:
Felix Project Team

Constructor Summary
FieldMetadata(String field, String type)
          Creates a field metadata.
 
Method Summary
 String getFieldName()
           
 String getFieldType()
           
static String getInternalPrimitiveType(String string)
          Gets the internal notation for primitive type.
static String getPrimitiveTypeByClass(Class clazz)
          Gets the iPOJO primitive type from the given primitive class.
static String getReflectionType(String type)
          Gets the 'reflective' type of the given type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldMetadata

public FieldMetadata(String field,
                     String type)
Creates a field metadata. This constructor can be used to avoid using PojoMetadata. Be care that creating such FieldMetadata does not assert its presence in the implementation class.

Parameters:
field - the field name.
type - the type of the field.
Method Detail

getFieldName

public String getFieldName()

getFieldType

public String getFieldType()

getReflectionType

public static String getReflectionType(String type)
Gets the 'reflective' type of the given type. The reflective type is the type used by the Java Reflection API. More precisely this method handles the array cases

Parameters:
type - the type to analyze to find the Java reflective type.
Returns:
the reflective type corresponding to this field.

getInternalPrimitiveType

public static String getInternalPrimitiveType(String string)
Gets the internal notation for primitive type.

Parameters:
string - the String form of the type
Returns:
the internal notation or null if not found

getPrimitiveTypeByClass

public static String getPrimitiveTypeByClass(Class clazz)
Gets the iPOJO primitive type from the given primitive class.

Parameters:
clazz - the class of the primitive type
Returns:
the iPOJO primitive type name or null if not found.


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.