Package io.github.dmlloyd.moduleinfo
Class ModuleInfoCreator
- java.lang.Object
-
- io.github.dmlloyd.moduleinfo.ModuleInfoCreator
-
public class ModuleInfoCreator extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private booleanaddExportsprivate booleanaddMandatoryprivate booleanaddPackages(package private) static intASM_VERSIONprivate java.util.List<java.nio.file.Path>classesPathsprivate java.lang.StringdefaultModuleName(package private) java.lang.StringdetectedClassPathAutoModuleName(package private) java.util.Set<java.lang.String>detectedClassPathPackages(package private) java.util.Map<java.lang.String,java.util.List<java.lang.String>>detectedClassPathProvides(package private) java.util.Set<java.lang.String>detectedClassPathUsesNames(package private) java.lang.StringdetectedClassPathVersionprivate booleandetectProvidesprivate booleandetectUsesprivate booleandetectVersionprivate booleanhelpprivate java.nio.file.PathmoduleInfoYmlprivate java.lang.StringmoduleNameprivate java.lang.StringmoduleVersionprivate static java.lang.String[]NO_STRINGSprivate java.nio.file.PathoutputDirectory
-
Constructor Summary
Constructors Constructor Description ModuleInfoCreator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.nio.file.Path>getClassesPaths()java.lang.StringgetDefaultModuleName()java.nio.file.PathgetModuleInfoYml()java.lang.StringgetModuleName()java.lang.StringgetModuleVersion()java.nio.file.PathgetOutputDirectory()booleanisAddExports()booleanisAddMandatory()booleanisAddPackages()private booleanisClassFile(java.nio.file.Path path)booleanisDetectProvides()booleanisDetectUses()booleanisDetectVersion()private booleanisInt(java.lang.String str)private booleanisManifest(java.nio.file.Path path)private booleanisMetaInf(java.nio.file.Path path)private booleanisMetaInfProviders(java.nio.file.Path path)private booleanisMetaInfServices(java.nio.file.Path path)private booleanisVersionDirectory(java.nio.file.Path path)static voidmain(java.lang.String[] args)private static <E> java.util.Set<E>newLinkedHashSet(java.lang.Object ignored)private static <T> java.util.List<T>newList(java.lang.Object ignored)private voidprocessAnnotation(ModuleAnnotation annotation, org.objectweb.asm.AnnotationVisitor annotationVisitor)private voidprocessAnnotation(org.objectweb.asm.ClassVisitor cv, ModuleAnnotation annotation)private voidprocessAnnotationValue(ModuleAnnotation annotation, org.objectweb.asm.AnnotationVisitor visitor, java.lang.String name, java.lang.Object value)private voidprocessAnnotationValues(ModuleAnnotation annotation, org.objectweb.asm.AnnotationVisitor visitor, java.util.List<?> list)private voidreadClassPathClassFile(java.nio.file.Path basePath, java.nio.file.Path path)(package private) voidreadClassPathFile(java.nio.file.Path basePath, java.nio.file.Path path)(package private) voidreadClassPathItem(java.nio.file.Path basePath, java.nio.file.Path path)private voidreadClassPathManifest(java.nio.file.Path basePath, java.nio.file.Path path)private voidreadClassPathProvidersFile(java.nio.file.Path basePath, java.nio.file.Path path)private voidreadClassPathServicesFile(java.nio.file.Path basePath, java.nio.file.Path path)voidrun()ModuleInfoCreatorsetAddExports(boolean addExports)ModuleInfoCreatorsetAddMandatory(boolean addMandatory)ModuleInfoCreatorsetAddPackages(boolean addPackages)ModuleInfoCreatorsetClassesPaths(java.util.List<java.nio.file.Path> classesPaths)voidsetDefaultModuleName(java.lang.String moduleName)ModuleInfoCreatorsetDetectProvides(boolean detectProvides)ModuleInfoCreatorsetDetectUses(boolean detectUses)ModuleInfoCreatorsetDetectVersion(boolean detectVersion)ModuleInfoCreatorsetModuleInfoYml(java.nio.file.Path moduleInfoYml)ModuleInfoCreatorsetModuleName(java.lang.String moduleName)ModuleInfoCreatorsetModuleVersion(java.lang.String moduleVersion)ModuleInfoCreatorsetOutputDirectory(java.nio.file.Path outputDirectory)
-
-
-
Field Detail
-
ASM_VERSION
static final int ASM_VERSION
- See Also:
- Constant Field Values
-
NO_STRINGS
private static final java.lang.String[] NO_STRINGS
-
moduleInfoYml
private java.nio.file.Path moduleInfoYml
-
outputDirectory
private java.nio.file.Path outputDirectory
-
classesPaths
private java.util.List<java.nio.file.Path> classesPaths
-
moduleName
private java.lang.String moduleName
-
moduleVersion
private java.lang.String moduleVersion
-
addMandatory
private boolean addMandatory
-
addPackages
private boolean addPackages
-
addExports
private boolean addExports
-
detectUses
private boolean detectUses
-
detectProvides
private boolean detectProvides
-
detectVersion
private boolean detectVersion
-
help
private boolean help
-
defaultModuleName
private java.lang.String defaultModuleName
-
detectedClassPathProvides
final java.util.Map<java.lang.String,java.util.List<java.lang.String>> detectedClassPathProvides
-
detectedClassPathUsesNames
final java.util.Set<java.lang.String> detectedClassPathUsesNames
-
detectedClassPathPackages
final java.util.Set<java.lang.String> detectedClassPathPackages
-
detectedClassPathVersion
java.lang.String detectedClassPathVersion
-
detectedClassPathAutoModuleName
java.lang.String detectedClassPathAutoModuleName
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.io.IOException, javax.xml.stream.XMLStreamException- Throws:
java.io.IOExceptionjavax.xml.stream.XMLStreamException
-
getModuleInfoYml
public java.nio.file.Path getModuleInfoYml()
-
setModuleInfoYml
public ModuleInfoCreator setModuleInfoYml(java.nio.file.Path moduleInfoYml)
-
getOutputDirectory
public java.nio.file.Path getOutputDirectory()
-
setOutputDirectory
public ModuleInfoCreator setOutputDirectory(java.nio.file.Path outputDirectory)
-
getClassesPaths
public java.util.List<java.nio.file.Path> getClassesPaths()
-
setClassesPaths
public ModuleInfoCreator setClassesPaths(java.util.List<java.nio.file.Path> classesPaths)
-
isAddPackages
public boolean isAddPackages()
-
setAddPackages
public ModuleInfoCreator setAddPackages(boolean addPackages)
-
isAddMandatory
public boolean isAddMandatory()
-
setAddMandatory
public ModuleInfoCreator setAddMandatory(boolean addMandatory)
-
isAddExports
public boolean isAddExports()
-
setAddExports
public ModuleInfoCreator setAddExports(boolean addExports)
-
isDetectUses
public boolean isDetectUses()
-
setDetectUses
public ModuleInfoCreator setDetectUses(boolean detectUses)
-
isDetectProvides
public boolean isDetectProvides()
-
setDetectProvides
public ModuleInfoCreator setDetectProvides(boolean detectProvides)
-
getModuleVersion
public java.lang.String getModuleVersion()
-
setModuleVersion
public ModuleInfoCreator setModuleVersion(java.lang.String moduleVersion)
-
getModuleName
public java.lang.String getModuleName()
-
setModuleName
public ModuleInfoCreator setModuleName(java.lang.String moduleName)
-
getDefaultModuleName
public java.lang.String getDefaultModuleName()
-
setDefaultModuleName
public void setDefaultModuleName(java.lang.String moduleName)
-
isDetectVersion
public boolean isDetectVersion()
-
setDetectVersion
public ModuleInfoCreator setDetectVersion(boolean detectVersion)
-
run
public void run() throws java.io.IOException, javax.xml.stream.XMLStreamException- Throws:
java.io.IOExceptionjavax.xml.stream.XMLStreamException
-
processAnnotation
private void processAnnotation(org.objectweb.asm.ClassVisitor cv, ModuleAnnotation annotation)
-
processAnnotation
private void processAnnotation(ModuleAnnotation annotation, org.objectweb.asm.AnnotationVisitor annotationVisitor)
-
processAnnotationValue
private void processAnnotationValue(ModuleAnnotation annotation, org.objectweb.asm.AnnotationVisitor visitor, java.lang.String name, java.lang.Object value)
-
processAnnotationValues
private void processAnnotationValues(ModuleAnnotation annotation, org.objectweb.asm.AnnotationVisitor visitor, java.util.List<?> list)
-
isClassFile
private boolean isClassFile(java.nio.file.Path path)
-
isMetaInf
private boolean isMetaInf(java.nio.file.Path path)
-
isVersionDirectory
private boolean isVersionDirectory(java.nio.file.Path path)
-
isInt
private boolean isInt(java.lang.String str)
-
isManifest
private boolean isManifest(java.nio.file.Path path)
-
isMetaInfServices
private boolean isMetaInfServices(java.nio.file.Path path)
-
isMetaInfProviders
private boolean isMetaInfProviders(java.nio.file.Path path)
-
readClassPathItem
void readClassPathItem(java.nio.file.Path basePath, java.nio.file.Path path) throws java.io.IOException- Throws:
java.io.IOException
-
readClassPathFile
void readClassPathFile(java.nio.file.Path basePath, java.nio.file.Path path) throws java.io.IOException- Throws:
java.io.IOException
-
readClassPathServicesFile
private void readClassPathServicesFile(java.nio.file.Path basePath, java.nio.file.Path path) throws java.io.IOException- Throws:
java.io.IOException
-
readClassPathProvidersFile
private void readClassPathProvidersFile(java.nio.file.Path basePath, java.nio.file.Path path) throws java.io.IOException- Throws:
java.io.IOException
-
readClassPathManifest
private void readClassPathManifest(java.nio.file.Path basePath, java.nio.file.Path path) throws java.io.IOException- Throws:
java.io.IOException
-
readClassPathClassFile
private void readClassPathClassFile(java.nio.file.Path basePath, java.nio.file.Path path) throws java.io.IOException- Throws:
java.io.IOException
-
newList
private static <T> java.util.List<T> newList(java.lang.Object ignored)
-
newLinkedHashSet
private static <E> java.util.Set<E> newLinkedHashSet(java.lang.Object ignored)
-
-