org.apache.felix.gogo.commands.converter

Class ReifiedType

    • Constructor Detail

      • ReifiedType

        public ReifiedType(Class clazz)
        Create a Reified Type for a raw Java class without any generic arguments. Subclasses can provide the optional generic argument information. Without subclassing, this instance has no type arguments.
        Parameters:
        clazz - The raw class of the Reified Type.
    • Method Detail

      • getRawClass

        public Class getRawClass()
        Access to the raw class. The raw class represents the concrete class that is associated with a type declaration. This class could have been deduced from the generics type graph of the declaration. For example, in the following example:
         Map<String, Object> map;
         
        The raw class is the Map class.
        Returns:
        the collapsed raw class that represents this type.
      • getActualTypeArgument

        public ReifiedType getActualTypeArgument(int i)
        Access to a type argument. The type argument refers to a argument in a generic type declaration given by index i. This method returns a Reified Type that has Object as class when no generic type information is available. Any object is assignable to Object and therefore no conversion is then necessary, this is compatible with older Javas than 5. For this reason, the implementation in this class always returns the Object class, regardless of the given index. This method should be overridden by a subclass that provides access to the generic information. For example, in the following example:
         Map<String, Object> map;
         
        The type argument 0 is String, and type argument 1 is Object.
        Parameters:
        i - The index of the type argument
        Returns:
        ReifiedType(Object.class), subclasses must override this and return the generic argument at index i
      • size

        public int size()
        Return the number of type arguments. This method should be overridden by a subclass to support Java 5 types.
        Returns:
        0, subclasses must override this and return the number of generic arguments

Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.