Class ClassCompatibility
- java.lang.Object
-
- net.officefloor.frame.compatibility.ClassCompatibility
-
public class ClassCompatibility extends java.lang.Object
EnablesClass
compatibility between Java versions by reflection (so can compile in different Java versions).- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClassCompatibility.ArgumentCompatibility
Argument compatibility.static class
ClassCompatibility.CompatibilityInvocationException
Indicates failure fromMethod
.class
ClassCompatibility.ObjectCompatibility
Provides compatibility for anObject
.
-
Constructor Summary
Constructors Constructor Description ClassCompatibility(java.lang.String className, java.lang.ClassLoader classLoader)
Instantiate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ClassCompatibility.ObjectCompatibility
_new(java.lang.Object... arguments)
Instantiate new instance of theObject
.ClassCompatibility.ObjectCompatibility
$(java.lang.String methodName, java.lang.Object... arguments)
UndertakesClass
staticMethod
.ClassCompatibility.ArgumentCompatibility
arg(java.lang.Object value, java.lang.Class<?> parameterType)
Creates anClassCompatibility.ArgumentCompatibility
for value.ClassCompatibility.ArgumentCompatibility
arg(java.lang.Object value, java.lang.String parameterTypeName)
Creates anClassCompatibility.ArgumentCompatibility
for value.static ClassCompatibility.ObjectCompatibility
object(java.lang.Object object)
Loads an existingObject
.
-
-
-
Method Detail
-
object
public static ClassCompatibility.ObjectCompatibility object(java.lang.Object object)
Loads an existingObject
.- Parameters:
object
-Object
.- Returns:
ClassCompatibility.ObjectCompatibility
wrapping theObject
.
-
$
public ClassCompatibility.ObjectCompatibility $(java.lang.String methodName, java.lang.Object... arguments)
UndertakesClass
staticMethod
.- Parameters:
methodName
- Name of the staticMethod
.arguments
- Arguments for theMethod
.- Returns:
ClassCompatibility.ObjectCompatibility
. Will benull
forvoid
method.
-
_new
public ClassCompatibility.ObjectCompatibility _new(java.lang.Object... arguments)
Instantiate new instance of theObject
.- Parameters:
arguments
- Arguments for the constructor.- Returns:
ClassCompatibility.ObjectCompatibility
for the constructedObject
.
-
arg
public ClassCompatibility.ArgumentCompatibility arg(java.lang.Object value, java.lang.Class<?> parameterType)
Creates anClassCompatibility.ArgumentCompatibility
for value.- Parameters:
value
- Value.parameterType
-Method
parameter type.- Returns:
ClassCompatibility.ArgumentCompatibility
.
-
arg
public ClassCompatibility.ArgumentCompatibility arg(java.lang.Object value, java.lang.String parameterTypeName)
Creates anClassCompatibility.ArgumentCompatibility
for value.- Parameters:
value
- Value.parameterTypeName
- Name of theMethod
parameter type.- Returns:
ClassCompatibility.ArgumentCompatibility
.
-
-