Package jadex.common
Class ClassInfo
java.lang.Object
jadex.common.ClassInfo
The class info struct serves for saving class information.
A class info may hold a class itself or the class name for
resolving the class. This struct should be used at all places
where classes are meant to be send to remote nodes. In this
case the class info will only transfer the class name forcing
the receiver to lookup the class itself. The class loader
for resolving a class info can be found by using the corresponding
resource identifier (rid) of the component or service that uses
the class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ClassLoader
The classloader with which this info was loaded.static final ClassInfo[]
Empty class info array.protected String
The generic type info (e.g.protected Class
<?> The service interface type.protected String
The service interface type as string. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Test if object is equal to this.Get class info in class name notation, i.e.Get the generic type name.Get the geninfo.Get class info in prefix notation, i.e.Class
<?> getType
(ClassLoader cl) Get the type.Class
<?> getType
(ClassLoader cl, String[] imports) Get the type.Class
<?> getType0()
Get the type, if availableGet the type name.int
hashCode()
Get the hashcode.void
setGeninfo
(String geninfo) The geninfo to set.void
setTheType
(Class<?> type) Set the type.void
setTypeName
(String typename) Set the name.toString()
Get the string representation.
-
Field Details
-
EMPYT_CLASSINFO_ARRAY
Empty class info array. -
typename
The service interface type as string. -
type
The service interface type. -
geninfo
The generic type info (e.g. when obtained via method parameter). -
classloader
The classloader with which this info was loaded. Note 1: This must not be the same as method.getClass().getClassLoader() because the latter returns the loader responsible for the class which could be higher in the parent hierarchy. Note 2: The check current_cl==last_cl is not perfect because when invoked with a parent classloader it will reload the class (although not necessary)
-
-
Constructor Details
-
ClassInfo
public ClassInfo()Create a new class info. -
ClassInfo
Create a new class info.- Parameters:
type
- The class info.
-
ClassInfo
Create a new class info.- Parameters:
type
- The class info.
-
ClassInfo
Create a new class info.- Parameters:
typename
- The class name.
-
-
Method Details
-
getTypeName
Get the type name.- Returns:
- the type name.
-
setTypeName
Set the name.- Parameters:
typename
- The name to set.
-
getType
Get the type.- Returns:
- The type.
-
getType
Get the type.- Returns:
- The type.
-
getType0
Get the type, if available- Returns:
- The type or null if not yet resolved.
-
setTheType
Set the type.- Parameters:
type
- The type to set.
-
getGenericTypeName
Get the generic type name.- Returns:
- The type name.
-
getGeninfo
Get the geninfo.- Returns:
- The geninfo
-
setGeninfo
The geninfo to set.- Parameters:
geninfo
- The geninfo to set
-
hashCode
public int hashCode()Get the hashcode. -
equals
Test if object is equal to this. -
toString
Get the string representation. -
getPrefixNotation
Get class info in prefix notation, i.e. String - java.lang -
getClassNameOnly
Get class info in class name notation, i.e. String
-