Interface Structure

  • All Superinterfaces:
    Field, Serializable
    All Known Implementing Classes:
    BaseStructure

    public interface Structure
    extends Field
    Reflection interface for structure field.
    Author:
    mrk
    • Method Detail

      • getField

        Field getField​(String fieldName)
        Get the Field for the specified fieldName
        Parameters:
        fieldName - the name of the field
        Returns:
        the Field that describes the field
      • getFieldIndex

        int getFieldIndex​(String fieldName)
        Get the index of the specified field.
        Parameters:
        fieldName - the name of the field
        Returns:
        the index or -1 if fieldName is not a field in the structure
      • getFields

        Field[] getFields()
        Get all the subfields of the structure.
        Returns:
        an array of Field that describes each of the subfields in the structure
      • getField

        Field getField​(int fieldIndex)
        Get a sub fields by index.
        Parameters:
        fieldIndex - the field index
        Returns:
        the field at specified index
      • getField

        <T extends Field> T getField​(Class<T> c,
                                     String fieldName)
        Get the Field for the specified fieldName
        Type Parameters:
        T - the expected type of the Field of the requested field
        Parameters:
        c - class object modeling the class T of expected type of the requested field
        fieldName - the fieldName
        Returns:
        The Field or null if the field does not exist, or the field is not of type T
      • getField

        <T extends Field> T getField​(Class<T> c,
                                     int fieldIndex)
        Get a subfield by index.
        Type Parameters:
        T - the expected type of the Field of the requested field
        Parameters:
        c - class object modeling the class T of expected type of the requested field
        fieldIndex - the index
        Returns:
        the Field or null if the field does not exist, or the field is not of type T
      • getFieldNames

        String[] getFieldNames()
        Get the array of the subfield names.
        Returns:
        the array
      • getFieldName

        String getFieldName​(int fieldIndex)
        Get the name of the subfield by index.
        Parameters:
        fieldIndex - the field index
        Returns:
        the name of the field