|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.adm.runtime.AdmCompatibility
public class AdmCompatibility
Holds the COMPATIBILITY_LEVEL
of the code generated from the
AdmModel
.
The current platform compatibility level is: "3.8.0"
The ADM compatibility level is of the form [MAJOR].[MINOR].[PATCH]. This version is
added to the AdmGenerated
annotation's compatLevel property. The ADM
COMPATIBILITY_LEVEL
is versioned separately from the rest of the
and does not correspond directly to the platform version. Modules in platform
code are corresponding versioned with their ADM api compatibility.
A bump in patch version may be used by a newer version to indicate that the generated code supports additional APIs or capabilities. For example, perhaps in 2.0.1 messages are generated to implement new formatting in its Json representation or with some new accessor apis that are available by reflection.
Generated 2.0.0 | Generated 2.0.1 | |
---|---|---|
Platform 2.0.0 | ✔ | ✓ |
Platform 2.0.1 | ✓ | ✓ |
An example of such a case would be when code generated with version 2.0.1
relies on new platform APIs that are not available in previous versions
of the runtime and would thus fail with a NoSuchMethodException
when operating with an older version of the platform. Another example of
this case would be if the newer version of the code relies on some semantic
behavior change in the existing platform API that would not be provided
by an older version of the platform.
Generated 2.0.0 | Generated 2.1.0 | |
---|---|---|
Platform 2.0.0 | ✓ | ✘ |
Platform 2.1.0 | ✓ | ✓ |
An example of this case would be where there are breaking API changes in the generated API, for example 3.0.0 might introduce a new method
Generated 2.0.0 | Generated 3.0.0 | |
---|---|---|
Platform 2.0.0 | ✓ | ✘ |
Platform 3.0.0 | ✘ | ✓ |
Field Summary | |
---|---|
static String |
COMPATIBILITY_LEVEL
The current ADM compatibility level ("3.8.0"). |
static String |
PROP_DISABLE_COMPATIBILITY_CHECKS
Setting this property to true in the XRuntime will cause runtime compatibility checks to be skipped. |
Constructor Summary | |
---|---|
AdmCompatibility()
|
Method Summary | |
---|---|
static void |
assertRuntimeCompatibility(String platformCompatLevel,
Class<?> type)
Assert that the given object is AdmGenerated and is compatible according to the
specified platform compatibility level. |
static void |
assertRuntimeCompatibility(String platformCompatLevel,
Object object)
Assert that the given object is AdmGenerated and is compatible according to the
specified platform compatibility level. |
static void |
getAdmGenerationDetails(Class<?> candidate,
StringBuilder builder)
Gets ADM Code generation details for the given class if available. |
static boolean |
isRuntimeCompatible(String platformCompatLevel,
String admCompatLevel)
Assert that the given object is AdmGenerated and is compatible according to the
specified platform compatibility level. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROP_DISABLE_COMPATIBILITY_CHECKS
XRuntime
will cause runtime compatibility checks to be skipped.
public static final String COMPATIBILITY_LEVEL
AdmCompatibility
,
Constant Field ValuesConstructor Detail |
---|
public AdmCompatibility()
Method Detail |
---|
public static final void assertRuntimeCompatibility(String platformCompatLevel, Class<?> type)
AdmGenerated
and is compatible according to the
specified platform compatibility level.
platformCompatLevel
- The platform compatibility level.type
- The AdmGenerated
annotated class to check.public static final void assertRuntimeCompatibility(String platformCompatLevel, Object object)
AdmGenerated
and is compatible according to the
specified platform compatibility level.
platformCompatLevel
- The platform compatibility level.object
- The AdmGenerated
annotated object to check.public static final boolean isRuntimeCompatible(String platformCompatLevel, String admCompatLevel)
AdmGenerated
and is compatible according to the
specified platform compatibility level.
platformCompatLevel
- The platform compatibility level.admCompatLevel
- The admCompatLevel to check.public static void getAdmGenerationDetails(Class<?> candidate, StringBuilder builder)
candidate
- The class for which to display the code generation details.builder
- The builder into which to print results.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |