Type
classin packageklyn
public class Type extends Object
└ Type

Class representing a type in the reflection system.

Fields
Modifier and Type Member Description
public const FLAG_ABSTRACT
FLAG_ABSTRACT as Int = 16
Flag used for abstract types/members.
public const FLAG_ANNOTATION
FLAG_ANNOTATION as Int = 1024
Flag used for annotations.
public const FLAG_CONST
FLAG_CONST as Int = 131072
Flag used for compile-time class constants.
public const FLAG_ENUM
FLAG_ENUM as Int = 2048
Flag used for enums.
public const FLAG_FINAL
FLAG_FINAL as Int = 32
Flag used for final types/members.
public const FLAG_INTERFACE
FLAG_INTERFACE as Int = 512
Flag used for interfaces.
public const FLAG_NATIVE
FLAG_NATIVE as Int = 128
Flag used for native members.
public const FLAG_OVERRIDE
FLAG_OVERRIDE as Int = 256
Flag used for override members.
public const FLAG_PRIVATE
FLAG_PRIVATE as Int = 2
Flag used for private members/types.
public const FLAG_PROTECTED
FLAG_PROTECTED as Int = 4
Flag used for protected members/types.
public const FLAG_PUBLIC
FLAG_PUBLIC as Int = 1
Flag used for public members/types.
public const FLAG_READONLY
FLAG_READONLY as Int = 64
Flag used for readonly members.
public const FLAG_STATIC
FLAG_STATIC as Int = 8
Flag used for static members.
public const FLAG_WRITEONLY
FLAG_WRITEONLY as Int = 262144
Flag used for write-only properties.
Properties
Modifier and Type Member Description
public readonly property annotations
annotations as ArrayList<Annotation>
Returns annotations applied to the type.
public readonly property attributes Reflected attributes declared on the type.
public readonly property fullName
fullName as String
Fully qualified type name.
public readonly property genericArgumentCount
genericArgumentCount as ULong
Returns the number of concrete generic arguments.
public readonly property genericDefinition
genericDefinition as Type
Returns the open generic type represented by this concrete instantiation.
public readonly property genericDefinitionName
genericDefinitionName as String
Returns the fully qualified open generic definition name.
public readonly property genericParameterCount
genericParameterCount as ULong
Returns the number of generic parameters declared by the base type.
public readonly property implementedInterfaces
implementedInterfaces as ArrayList<Type>
Returns interfaces implemented by this type.
public readonly property isAbstract
isAbstract as Boolean
Indicates whether the type is abstract.
public readonly property isAnnotation
isAnnotation as Boolean
Indicates whether the type is an annotation.
public readonly property isEnum
isEnum as Boolean
Indicates whether the type is an enum.
public readonly property isFinal
isFinal as Boolean
Indicates whether the type is final.
public readonly property isGenericInstantiation
isGenericInstantiation as Boolean
Indicates whether this type represents a concrete generic instantiation.
public readonly property isInterface
isInterface as Boolean
Indicates whether the type is an interface.
public readonly property isNative
isNative as Boolean
Indicates whether the type is native.
public readonly property isOverride
isOverride as Boolean
Indicates whether the type is marked as override.
public readonly property isPrivate
isPrivate as Boolean
Indicates whether the type is private.
public readonly property isProtected
isProtected as Boolean
Indicates whether the type is protected.
public readonly property isPublic
isPublic as Boolean
Indicates whether the type is public.
public readonly property isReadonly
isReadonly as Boolean
Indicates whether the type is marked readonly.
public readonly property isStatic
isStatic as Boolean
Indicates whether the type is static.
public readonly property name
name as String
Short type name without package prefix.
public readonly property superType
superType as Type
Returns the direct parent type, if any.
Inherited Properties
propertyInherited Properties from Object: type
Constructors
Modifier and Type Member Description
public Type
Type(name as String, fullName as String, flags as Int = 0, superName as String = "")
Constructor for Type
Methods
Modifier and Type Member Description
public createInstance
createInstance(args... as Object) as Object throws Exception
Creates an instance of this type through reflection.
public genericArguments
genericArguments() as ArrayList<Type>
Returns the concrete generic arguments in declaration order.
public genericParameterNames
genericParameterNames() as ArrayList<String>
Returns the generic parameter names declared by the base type.
public getAttribute
getAttribute(attributeName as String, notInherited as Boolean = true) as klyn.reflection.Attribute
Method to get a specific attribute of the type.
public getAttributes
getAttributes(notInherited as Boolean = true) as ArrayList<klyn.reflection.Attribute>
Method to get the attributes of the type.
public getConstructor
getConstructor(arity as Long = 0) as Constructor
Returns constructor metadata invocable with the requested arity.
public getConstructors
getConstructors() as ArrayList<Constructor>
Returns constructors declared on this type.
public getMethod
getMethod(methodName as String, notInherited as Boolean = true, types... as Type) as Method
Method to get a specific method of the type.
public getMethods
getMethods(notInherited as Boolean = true) as ArrayList<Method>
Method to get the methods of the type.
public getProperties
getProperties(notInherited as Boolean = true) as ArrayList<klyn.reflection.Property>
Method to get the properties of the type.
public getProperty
getProperty(propertyName as String, notInherited as Boolean = true) as Property
Method to get a specific property of the type.
public override hash
hash() as Long
Returns the hash of the qualified name used by type equality.
public override toString
toString() as String
Returns the full type name when available.
Inherited Methods
methodInherited Methods from Object: deepCopy, fromJson, hash, toDict, toJson, toMap, toString, toXml
Operators
Modifier and Type Member Description
public static operator!=(left as Type, right as Type) as Boolean Returns the negation of type equality.
public static operator==(left as Type, right as Type) as Boolean Compares two reflected types by full name.