Package ftbsc.lll.processor.containers
Class ClassContainer
- java.lang.Object
-
- ftbsc.lll.processor.containers.ClassContainer
-
public class ClassContainer extends java.lang.Object
Container for information about a class. Used internally for efficiency reasons.- Since:
- 0.5.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ClassContainer
findOrFallback(ClassContainer fallback, Patch p, Find f, ProcessorOptions options)
Finds and builds aClassContainer
based on information contained withinPatch
or aFind
annotations, else returns a fallback.static ClassContainer
from(javax.lang.model.element.TypeElement cl, ProcessorOptions options)
Safely extracts aClass
from an annotation and gets its fully qualified name.static <T extends java.lang.annotation.Annotation>
ClassContainerfrom(T ann, java.util.function.Function<T,java.lang.Class<?>> classFunction, java.lang.String[] innerNames, ProcessorOptions options)
Safely extracts aClass
from an annotation and gets its fully qualified name.
-
-
-
Field Detail
-
data
public final ftbsc.lll.mapper.data.ClassData data
TheClassData
for the class represented by this container.
-
elem
public final javax.lang.model.element.TypeElement elem
TheTypeElement
corresponding to the class. May only be null intentionally i.e. when the associated element is an anonymous class or a child of an anonymous class.
-
-
Method Detail
-
from
public static <T extends java.lang.annotation.Annotation> ClassContainer from(T ann, java.util.function.Function<T,java.lang.Class<?>> classFunction, java.lang.String[] innerNames, ProcessorOptions options)
Safely extracts aClass
from an annotation and gets its fully qualified name.- Type Parameters:
T
- the type of the annotation carrying the information- Parameters:
ann
- the annotation containing the classclassFunction
- the annotation function returning the classinnerNames
- a string containing the inner class name or nothingoptions
- theProcessorOptions
to be used- Returns:
- the fully qualified name of the given class
- Since:
- 0.5.0
-
from
public static ClassContainer from(javax.lang.model.element.TypeElement cl, ProcessorOptions options)
Safely extracts aClass
from an annotation and gets its fully qualified name.- Parameters:
cl
- theTypeElement
representing the classoptions
- theProcessorOptions
to be used- Returns:
- the fully qualified name of the given class
- Since:
- 0.6.0
-
findOrFallback
public static ClassContainer findOrFallback(ClassContainer fallback, Patch p, Find f, ProcessorOptions options)
Finds and builds aClassContainer
based on information contained withinPatch
or aFind
annotations, else returns a fallback.- Parameters:
fallback
- theClassContainer
it falls back onp
- thePatch
annotation to get info fromf
- theFind
annotation to get info fromoptions
- theProcessorOptions
to be used- Returns:
- the built
ClassContainer
or the fallback if not enough information was present - Since:
- 0.5.0
-
-