Klasse ExpressionClassType

java.lang.Object
de.svws_nrw.transpiler.ExpressionType
de.svws_nrw.transpiler.ExpressionClassType
Alle implementierten Schnittstellen:
Tree

public final class ExpressionClassType extends ExpressionType
The specialized ExpressionType if the type is a class type.
  • Methodendetails

    • getExpressionInterfaceType

      public static ExpressionClassType getExpressionInterfaceType(String name, String packageName)
      Creates a new expression interface type instance from the specified paramaters.
      Parameter:
      name - the interface name
      packageName - the packagename of the interface
      Gibt zurück:
      the new expression class type instance
    • getExpressionAnnotationType

      public static ExpressionClassType getExpressionAnnotationType(String name, String packageName)
      Creates a new expression annotation type instance from the specified paramaters.
      Parameter:
      name - the annotation name
      packageName - the packagename of the annotation
      Gibt zurück:
      the new expression class type instance
    • getExpressionSuperClassType

      public static ExpressionClassType getExpressionSuperClassType()
      Creates a new expression class type instance for the unknown super class.
      Gibt zurück:
      the new expression class type instance
    • getExpressionClassType

      public static ExpressionClassType getExpressionClassType(Transpiler transpiler, TypeMirror type) throws TranspilerException
      Creates a new expression class type instance from the specified TypeMirror
      Parameter:
      transpiler - the transpiler used for determining the expression type
      type - the type mirror
      Gibt zurück:
      the new expression class type instance
      Löst aus:
      TranspilerException - an exception if analyzing the type arguments fails
    • getExpressionClassType

      public static ExpressionClassType getExpressionClassType(Transpiler transpiler, TypeElement elem)
      Creates a new expression class type instance from the specified TypeElement
      Parameter:
      transpiler - the transpiler used for determining the expression type
      elem - the type element
      Gibt zurück:
      the new expression class type instance
    • getExpressionClassType

      public static ExpressionClassType getExpressionClassType(Transpiler transpiler, ParameterizedTypeTree tree)
      Creates a new expression class type instance from the specified ParameterizedTypeTree
      Parameter:
      transpiler - the transpiler used for determining the expression type
      tree - the parameterized type tree node
      Gibt zurück:
      the new expression class type instance
    • getExpressionClassType

      public static ExpressionClassType getExpressionClassType(Transpiler transpiler, MemberSelectTree tree)
      Creates a new expression class type instance from the specified MemberSelectTree
      Parameter:
      transpiler - the transpiler used for determining the expression type
      tree - the member select type tree node
      Gibt zurück:
      the new expression class type instance
    • getExpressionClassType

      public static ExpressionClassType getExpressionClassType(Transpiler transpiler, ExpressionClassType clParamType)
      Creates a new parameterized expression class type instance for java.lang.Class with the specified parameter class type.
      Parameter:
      transpiler - the transpiler used for determining the expression type
      clParamType - the parameter class type
      Gibt zurück:
      the new expression class type instance
    • getExpressionClassType

      public static ExpressionClassType getExpressionClassType(Transpiler transpiler, IdentifierTree node)
      Create a new class type instance for the specified identifier node object.
      Parameter:
      transpiler - the transpiler used for determining the expression type
      node - the identifier node instance
      Gibt zurück:
      the new expression class type instance or null on error
    • getPackageName

      public String getPackageName()
      Returns the package name.
      Gibt zurück:
      the package name
    • getFullQualifiedName

      public String getFullQualifiedName()
      Returns the full qualified name of the class, i.e. without the list of type parameters if type parameters exist
      Gibt zurück:
      the full qualified name of the class
    • getTypeArgumentCount

      public int getTypeArgumentCount()
      Returns the number of type arguments/variables of this class type.
      Gibt zurück:
      the number of type arguments/variables
    • resolveTypeVariables

      public boolean resolveTypeVariables(Map<String,ExpressionType> knownTypeVars)
      Resolves the type variables using the specified map and writes the expression type into the typeArguments list.
      Parameter:
      knownTypeVars - the mapping of type variables to the type arguments
      Gibt zurück:
      true on success and false if not all type variables could be resolved
    • getTypeArguments

      public List<ExpressionType> getTypeArguments()
      Returns the list of type arguments of this class. If no type arguments are available an empty list is returned.
      Gibt zurück:
      the list of type arguments
    • getTypeVariables

      public List<ExpressionTypeVar> getTypeVariables()
      Returns the list of type variables of this class. If no type variables are available an empty list is returned.
      Gibt zurück:
      the list of type variables
    • isPrimitiveOrBoxedPrimitive

      public boolean isPrimitiveOrBoxedPrimitive()
      Beschreibung aus Klasse kopiert: ExpressionType
      Returns whether the type is a primitive type or a boxed primitive type.
      Angegeben von:
      isPrimitiveOrBoxedPrimitive in Klasse ExpressionType
      Gibt zurück:
      true if it is a primitive type and false otherwise
    • isNumberType

      public boolean isNumberType()
      Beschreibung aus Klasse kopiert: ExpressionType
      Checks whether this type is a numeric or boxed numeric type. The method is an override in the subclasses ExpressionPrimitiveType and ExpressionClassType.
      Setzt außer Kraft:
      isNumberType in Klasse ExpressionType
      Gibt zurück:
      true if it is a numeric type and false otherwise.
    • isIntegerType

      public boolean isIntegerType()
      Beschreibung aus Klasse kopiert: ExpressionType
      Checks whether this type is an integer type. The method is an override in the subclasses ExpressionPrimitiveType and ExpressionClassType.
      Setzt außer Kraft:
      isIntegerType in Klasse ExpressionType
      Gibt zurück:
      true if it is an integer type and false otherwise.
    • isAssignable

      public int isAssignable(Transpiler transpiler, ExpressionType other)
      Beschreibung aus Klasse kopiert: ExpressionType
      Checks whether a values of the specified type other is assignable to a variable of this type or not. If a value of that type is not assignable a negative value is returned. A zero or positive value is returned if it is assignable. A zero value indicates a perfect type match and greater values indicate a less perfect type match, e.g. unboxing of a primitive type is required or the a value of a sub class type should be assigned.
      Angegeben von:
      isAssignable in Klasse ExpressionType
      Parameter:
      transpiler - the transpiler object used for utility methods
      other - the other type
      Gibt zurück:
      a postive value or zero if the type is assignable and a negative value if not.
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • hashCode

      public int hashCode()
      Beschreibung aus Klasse kopiert: ExpressionType
      Returns the hashCode for the expression type.
      Setzt außer Kraft:
      hashCode in Klasse ExpressionType
      Gibt zurück:
      the hash code
    • equals

      public boolean equals(Object obj)
      Beschreibung aus Klasse kopiert: ExpressionType
      Returns whether the object parameter ist equal to this expression type or not
      Setzt außer Kraft:
      equals in Klasse ExpressionType
      Gibt zurück:
      true if both are equal