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 boolean
addExports
private boolean
addMandatory
private boolean
addPackages
(package private) static int
ASM_VERSION
private java.util.List<java.nio.file.Path>
classesPaths
private java.lang.String
defaultModuleName
(package private) java.lang.String
detectedClassPathAutoModuleName
(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.String
detectedClassPathVersion
private boolean
detectProvides
private boolean
detectUses
private boolean
detectVersion
private boolean
help
private java.nio.file.Path
moduleInfoYml
private java.lang.String
moduleName
private java.lang.String
moduleVersion
private static java.lang.String[]
NO_STRINGS
private java.nio.file.Path
outputDirectory
-
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.String
getDefaultModuleName()
java.nio.file.Path
getModuleInfoYml()
java.lang.String
getModuleName()
java.lang.String
getModuleVersion()
java.nio.file.Path
getOutputDirectory()
boolean
isAddExports()
boolean
isAddMandatory()
boolean
isAddPackages()
private boolean
isClassFile(java.nio.file.Path path)
boolean
isDetectProvides()
boolean
isDetectUses()
boolean
isDetectVersion()
private boolean
isInt(java.lang.String str)
private boolean
isManifest(java.nio.file.Path path)
private boolean
isMetaInf(java.nio.file.Path path)
private boolean
isMetaInfProviders(java.nio.file.Path path)
private boolean
isMetaInfServices(java.nio.file.Path path)
private boolean
isVersionDirectory(java.nio.file.Path path)
static void
main(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 void
processAnnotation(ModuleAnnotation annotation, org.objectweb.asm.AnnotationVisitor annotationVisitor)
private void
processAnnotation(org.objectweb.asm.ClassVisitor cv, ModuleAnnotation annotation)
private void
processAnnotationValue(ModuleAnnotation annotation, org.objectweb.asm.AnnotationVisitor visitor, java.lang.String name, java.lang.Object value)
private void
processAnnotationValues(ModuleAnnotation annotation, org.objectweb.asm.AnnotationVisitor visitor, java.util.List<?> list)
private void
readClassPathClassFile(java.nio.file.Path basePath, java.nio.file.Path path)
(package private) void
readClassPathFile(java.nio.file.Path basePath, java.nio.file.Path path)
(package private) void
readClassPathItem(java.nio.file.Path basePath, java.nio.file.Path path)
private void
readClassPathManifest(java.nio.file.Path basePath, java.nio.file.Path path)
private void
readClassPathProvidersFile(java.nio.file.Path basePath, java.nio.file.Path path)
private void
readClassPathServicesFile(java.nio.file.Path basePath, java.nio.file.Path path)
void
run()
ModuleInfoCreator
setAddExports(boolean addExports)
ModuleInfoCreator
setAddMandatory(boolean addMandatory)
ModuleInfoCreator
setAddPackages(boolean addPackages)
ModuleInfoCreator
setClassesPaths(java.util.List<java.nio.file.Path> classesPaths)
void
setDefaultModuleName(java.lang.String moduleName)
ModuleInfoCreator
setDetectProvides(boolean detectProvides)
ModuleInfoCreator
setDetectUses(boolean detectUses)
ModuleInfoCreator
setDetectVersion(boolean detectVersion)
ModuleInfoCreator
setModuleInfoYml(java.nio.file.Path moduleInfoYml)
ModuleInfoCreator
setModuleName(java.lang.String moduleName)
ModuleInfoCreator
setModuleVersion(java.lang.String moduleVersion)
ModuleInfoCreator
setOutputDirectory(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.IOException
javax.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.IOException
javax.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)
-
-