net.ontopia.persistence.proxy
Class FieldUtils

java.lang.Object
  extended by net.ontopia.persistence.proxy.FieldUtils

public class FieldUtils
extends java.lang.Object

INTERNAL: Class containing utility methods for processing descriptor information.


Constructor Summary
FieldUtils()
           
 
Method Summary
protected static void accumulateImplementedInterfaces(java.lang.Class klass, java.util.Set result)
          INTERNAL: Accumulates the interfaces implemented by this class and its superclasses.
static void addColumns(FieldInfoIF[] fields, java.util.Collection columns)
           
static void addColumns(FieldInfoIF field, java.util.Collection columns)
           
static FieldInfoIF[] filterAggregate(FieldInfoIF[] finfos)
          INTERNAL: Filters out all but the aggregate field infos.
static FieldDescriptor[] filterByCardinality(FieldDescriptor[] fdescs, int cardinality)
          INTERNAL: Filters the field descriptors by cardinality.
static FieldInfoIF[] filterByCardinality(FieldInfoIF[] finfos, int cardinality)
          INTERNAL: Filters the field infos by cardinality.
static FieldDescriptor[] filterByTable(FieldDescriptor[] fdescs, java.lang.String table)
          INTERNAL: Returns the field descriptors that are stored in the specified table.
static int getColumnCount(FieldInfoIF[] fields)
          INTERNAL: Returns the number of columns that the fields span.
static int[] getColumnOffsets(FieldHandlerIF[] fhandlers, int start)
          INTERNAL: Utility method that creates an int array containing the result set index for which the field handler should start reading.
static java.lang.String[] getColumns(FieldInfoIF[] fields)
          INTERNAL: Returns the names of the value columns that the fields span.
static java.lang.String[] getFieldNames(FieldDescriptor[] fields)
          INTERNAL: Utility method that extracts the field names of an array of field descriptors.
static java.lang.reflect.Method getGetterMethod(FieldDescriptor fdesc)
          INTERNAL: Returns the getter methods for the given field descriptor.
static java.lang.Class[] getImplementedInterfaces(java.lang.Class klass)
          INTERNAL: Returns all interfaces implemented by this class and its superclasses.
static java.lang.Class getPrimitiveClass(java.lang.Class klass)
          INTERNAL: Returns the primitive class for the specified primitive wrapper class.
static int[] getResultSetOffsets(FieldHandlerIF[] fhandlers)
          INTERNAL: Utility method that creates an int array containing the result set index for which the field handler should start reading.
static java.lang.reflect.Method getSetterMethod(FieldDescriptor fdesc)
          INTERNAL: Returns the setter methods for the given field descriptor.
static java.lang.String[] getTables(FieldInfoIF[] fields)
          INTERNAL: Returns an array containing the tables in which the fields are stored.
static FieldInfoIF[] joinFieldInfos(FieldInfoIF[] a, FieldInfoIF[] b)
          INTERNAL: Joins the two FieldInfoIF arrays by producing a new composite string array.
static java.lang.String[] joinStrings(java.lang.String[] a, java.lang.String[] b)
          INTERNAL: Joins the two String arrays by producing a new composite string array.
static FieldDescriptor[] toFieldDescriptorArray(java.util.Collection fdescs)
          INTERNAL: Utility method that converts a collection of field descriptors to an array of field descriptors.
static FieldInfoIF[] toFieldInfoArray(java.util.Collection finfos)
          INTERNAL: Utility method that converts a collection of field infos to an array of field infos.
static java.lang.String[] toStringArray(java.util.Collection strings)
          INTERNAL: Utility method that converts a collection of strings to an array of strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldUtils

public FieldUtils()
Method Detail

getTables

public static java.lang.String[] getTables(FieldInfoIF[] fields)
INTERNAL: Returns an array containing the tables in which the fields are stored.


getColumns

public static java.lang.String[] getColumns(FieldInfoIF[] fields)
INTERNAL: Returns the names of the value columns that the fields span.


addColumns

public static void addColumns(FieldInfoIF field,
                              java.util.Collection columns)

addColumns

public static void addColumns(FieldInfoIF[] fields,
                              java.util.Collection columns)

getColumnCount

public static int getColumnCount(FieldInfoIF[] fields)
INTERNAL: Returns the number of columns that the fields span.


getColumnOffsets

public static int[] getColumnOffsets(FieldHandlerIF[] fhandlers,
                                     int start)
INTERNAL: Utility method that creates an int array containing the result set index for which the field handler should start reading. Note that result set indexes are 1-indexed.


getResultSetOffsets

public static int[] getResultSetOffsets(FieldHandlerIF[] fhandlers)
INTERNAL: Utility method that creates an int array containing the result set index for which the field handler should start reading. Note that result set indexes are 1-indexed.


filterByCardinality

public static FieldDescriptor[] filterByCardinality(FieldDescriptor[] fdescs,
                                                    int cardinality)
INTERNAL: Filters the field descriptors by cardinality.


filterByCardinality

public static FieldInfoIF[] filterByCardinality(FieldInfoIF[] finfos,
                                                int cardinality)
INTERNAL: Filters the field infos by cardinality.


filterAggregate

public static FieldInfoIF[] filterAggregate(FieldInfoIF[] finfos)
INTERNAL: Filters out all but the aggregate field infos.


filterByTable

public static FieldDescriptor[] filterByTable(FieldDescriptor[] fdescs,
                                              java.lang.String table)
INTERNAL: Returns the field descriptors that are stored in the specified table.


getGetterMethod

public static java.lang.reflect.Method getGetterMethod(FieldDescriptor fdesc)
                                                throws java.lang.Exception
INTERNAL: Returns the getter methods for the given field descriptor. This method uses reflection to locate the method.

Throws:
java.lang.Exception

getSetterMethod

public static java.lang.reflect.Method getSetterMethod(FieldDescriptor fdesc)
                                                throws java.lang.Exception
INTERNAL: Returns the setter methods for the given field descriptor. This method uses reflection to locate the method.

Throws:
java.lang.Exception

getPrimitiveClass

public static java.lang.Class getPrimitiveClass(java.lang.Class klass)
INTERNAL: Returns the primitive class for the specified primitive wrapper class.


getImplementedInterfaces

public static java.lang.Class[] getImplementedInterfaces(java.lang.Class klass)
INTERNAL: Returns all interfaces implemented by this class and its superclasses.


accumulateImplementedInterfaces

protected static void accumulateImplementedInterfaces(java.lang.Class klass,
                                                      java.util.Set result)
INTERNAL: Accumulates the interfaces implemented by this class and its superclasses. All recognized interfaces are added to the result argument collection.


joinStrings

public static java.lang.String[] joinStrings(java.lang.String[] a,
                                             java.lang.String[] b)
INTERNAL: Joins the two String arrays by producing a new composite string array.


joinFieldInfos

public static FieldInfoIF[] joinFieldInfos(FieldInfoIF[] a,
                                           FieldInfoIF[] b)
INTERNAL: Joins the two FieldInfoIF arrays by producing a new composite string array.


toStringArray

public static java.lang.String[] toStringArray(java.util.Collection strings)
INTERNAL: Utility method that converts a collection of strings to an array of strings.


toFieldDescriptorArray

public static FieldDescriptor[] toFieldDescriptorArray(java.util.Collection fdescs)
INTERNAL: Utility method that converts a collection of field descriptors to an array of field descriptors.


toFieldInfoArray

public static FieldInfoIF[] toFieldInfoArray(java.util.Collection finfos)
INTERNAL: Utility method that converts a collection of field infos to an array of field infos.


getFieldNames

public static java.lang.String[] getFieldNames(FieldDescriptor[] fields)
INTERNAL: Utility method that extracts the field names of an array of field descriptors.



Copyright © 2000-2012 Ontopia.