Class DefaultVersionInformation
- java.lang.Object
-
- org.mapstruct.ap.internal.processor.DefaultVersionInformation
-
- All Implemented Interfaces:
VersionInformation
public class DefaultVersionInformation extends java.lang.Object implements VersionInformation
Provides information about the processor version and the processor context implementation version.Separated into an interface and this implementation to avoid cyclic dependencies between the processor package and the model package.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringcompilerprivate static java.lang.StringCOMPILER_NAME_ECLIPSE_JDTprivate static java.lang.StringCOMPILER_NAME_JAVACprivate booleaneclipseJDTprivate booleanjavacprivate static java.lang.StringJAVAC_PE_CLASSprivate static java.lang.StringJDT_BATCH_PE_CLASSprivate static java.lang.StringJDT_IDE_PE_CLASSprivate static java.lang.StringMAP_STRUCT_VERSIONprivate java.lang.StringruntimeVendorprivate java.lang.StringruntimeVersionprivate booleansourceVersionAtLeast9
-
Constructor Summary
Constructors Constructor Description DefaultVersionInformation(java.lang.String runtimeVersion, java.lang.String runtimeVendor, java.lang.String compiler, javax.lang.model.SourceVersion sourceVersion)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.StringasClassFileName(java.lang.String className)private static java.net.URLcreateManifestUrl(java.lang.String classFileName, java.net.URL resource)private static java.lang.StringextractBundleName(java.util.jar.Manifest manifest)private static java.lang.StringextractJarFileName(java.lang.String file)private static java.lang.StringextractJrtModuleName(java.net.URL resource)(package private) static DefaultVersionInformationfromProcessingEnvironment(javax.annotation.processing.ProcessingEnvironment processingEnv)java.lang.StringgetCompiler()private static java.lang.StringgetCompiler(javax.annotation.processing.ProcessingEnvironment processingEnv)private static java.lang.StringgetLibraryName(java.lang.Class<?> clazz, boolean preferVersionOnly)java.lang.StringgetMapStructVersion()java.lang.StringgetRuntimeVendor()java.lang.StringgetRuntimeVersion()private static java.lang.StringinitMapStructVersion()booleanisEclipseJDTCompiler()booleanisJavacCompiler()booleanisSourceVersionAtLeast9()private static java.util.jar.ManifestopenManifest(java.lang.String classFileName, java.net.URL resource)
-
-
-
Field Detail
-
JAVAC_PE_CLASS
private static final java.lang.String JAVAC_PE_CLASS
- See Also:
- Constant Field Values
-
COMPILER_NAME_JAVAC
private static final java.lang.String COMPILER_NAME_JAVAC
- See Also:
- Constant Field Values
-
JDT_IDE_PE_CLASS
private static final java.lang.String JDT_IDE_PE_CLASS
- See Also:
- Constant Field Values
-
JDT_BATCH_PE_CLASS
private static final java.lang.String JDT_BATCH_PE_CLASS
- See Also:
- Constant Field Values
-
COMPILER_NAME_ECLIPSE_JDT
private static final java.lang.String COMPILER_NAME_ECLIPSE_JDT
- See Also:
- Constant Field Values
-
MAP_STRUCT_VERSION
private static final java.lang.String MAP_STRUCT_VERSION
-
runtimeVersion
private final java.lang.String runtimeVersion
-
runtimeVendor
private final java.lang.String runtimeVendor
-
compiler
private final java.lang.String compiler
-
sourceVersionAtLeast9
private final boolean sourceVersionAtLeast9
-
eclipseJDT
private final boolean eclipseJDT
-
javac
private final boolean javac
-
-
Method Detail
-
getRuntimeVersion
public java.lang.String getRuntimeVersion()
- Specified by:
getRuntimeVersionin interfaceVersionInformation
-
getRuntimeVendor
public java.lang.String getRuntimeVendor()
- Specified by:
getRuntimeVendorin interfaceVersionInformation
-
getMapStructVersion
public java.lang.String getMapStructVersion()
- Specified by:
getMapStructVersionin interfaceVersionInformation
-
getCompiler
public java.lang.String getCompiler()
- Specified by:
getCompilerin interfaceVersionInformation
-
isSourceVersionAtLeast9
public boolean isSourceVersionAtLeast9()
- Specified by:
isSourceVersionAtLeast9in interfaceVersionInformation
-
isEclipseJDTCompiler
public boolean isEclipseJDTCompiler()
- Specified by:
isEclipseJDTCompilerin interfaceVersionInformation
-
isJavacCompiler
public boolean isJavacCompiler()
- Specified by:
isJavacCompilerin interfaceVersionInformation
-
fromProcessingEnvironment
static DefaultVersionInformation fromProcessingEnvironment(javax.annotation.processing.ProcessingEnvironment processingEnv)
-
getCompiler
private static java.lang.String getCompiler(javax.annotation.processing.ProcessingEnvironment processingEnv)
-
getLibraryName
private static java.lang.String getLibraryName(java.lang.Class<?> clazz, boolean preferVersionOnly)
-
openManifest
private static java.util.jar.Manifest openManifest(java.lang.String classFileName, java.net.URL resource)
-
extractBundleName
private static java.lang.String extractBundleName(java.util.jar.Manifest manifest)
-
extractJrtModuleName
private static java.lang.String extractJrtModuleName(java.net.URL resource)
-
createManifestUrl
private static java.net.URL createManifestUrl(java.lang.String classFileName, java.net.URL resource) throws java.net.MalformedURLException- Throws:
java.net.MalformedURLException
-
asClassFileName
private static java.lang.String asClassFileName(java.lang.String className)
-
extractJarFileName
private static java.lang.String extractJarFileName(java.lang.String file)
-
initMapStructVersion
private static java.lang.String initMapStructVersion()
-
-