Package org.jboss.logging.processor.apt
Class MessageInterfaceFactory.LoggerInterface
- java.lang.Object
-
- org.jboss.logging.processor.apt.AbstractClassType
-
- org.jboss.logging.processor.apt.MessageInterfaceFactory.LoggerInterface
-
- All Implemented Interfaces:
java.lang.Comparable<MessageInterface>
,javax.lang.model.AnnotatedConstruct
,javax.lang.model.element.Element
,javax.lang.model.element.Parameterizable
,javax.lang.model.element.QualifiedNameable
,javax.lang.model.element.TypeElement
,ClassType
,DelegatingElement
,DelegatingTypeElement
,JavaDocComment
,MessageInterface
- Enclosing class:
- MessageInterfaceFactory
private static class MessageInterfaceFactory.LoggerInterface extends AbstractClassType implements MessageInterface
-
-
Field Summary
Fields Modifier and Type Field Description private javax.lang.model.element.TypeElement
loggerInterface
private java.util.Set<MessageMethod>
messageMethods
-
Fields inherited from class org.jboss.logging.processor.apt.AbstractClassType
elements, processingEnv, typeMirror, types
-
-
Constructor Summary
Constructors Modifier Constructor Description private
LoggerInterface(javax.annotation.processing.ProcessingEnvironment processingEnv, javax.lang.model.element.TypeElement loggerInterface)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(MessageInterface o)
boolean
equals(java.lang.Object obj)
java.util.Set<MessageInterface>
extendedInterfaces()
A set of qualified interface names this interface extends or an empty set.boolean
extendsLoggerInterface()
Checks the interface to see if thelogger interface
is being extended in this interface.java.lang.String
getComment()
The JavaDoc comments if available ornull
if there are no JavaDoc's present.javax.lang.model.element.TypeElement
getDelegate()
The element to delegate the default methods to.int
getIdLength()
The length to pad the id with.int
hashCode()
private void
init()
java.lang.String
loggingFQCN()
The fully qualified class name to use for log methods.java.util.Collection<MessageMethod>
methods()
A collection of all the methods this interface needs to implement.java.lang.String
name()
The qualified name of the message interface.(package private) static MessageInterfaceFactory.LoggerInterface
of(javax.annotation.processing.ProcessingEnvironment processingEnv)
java.lang.String
packageName()
The package name of the message interface.java.lang.String
projectCode()
The project code for the message interface ornull
if not annotated with@MessageBundle
or@MessageLogger
.java.lang.String
simpleName()
The name of the interface without the package.java.lang.String
toString()
java.util.List<ValidIdRange>
validIdRanges()
Returns a list ofvalid id ranges
.-
Methods inherited from class org.jboss.logging.processor.apt.AbstractClassType
isAssignableFrom, isSameAs, isSubtypeOf
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jboss.logging.processor.model.ClassType
isAssignableFrom, isSameAs, isSubtypeOf
-
Methods inherited from interface org.jboss.logging.processor.model.DelegatingElement
accept, getAnnotation, getAnnotationMirrors, getAnnotationsByType, getKind, getModifiers, isAnnotatedWith
-
Methods inherited from interface org.jboss.logging.processor.model.DelegatingTypeElement
asType, getEnclosedElements, getEnclosingElement, getInterfaces, getNestingKind, getQualifiedName, getSimpleName, getSuperclass, getTypeParameters
-
Methods inherited from interface org.jboss.logging.processor.model.MessageInterface
expressionProperties, generatedAnnotation
-
-
-
-
Field Detail
-
loggerInterface
private final javax.lang.model.element.TypeElement loggerInterface
-
messageMethods
private final java.util.Set<MessageMethod> messageMethods
-
-
Method Detail
-
init
private void init()
-
of
static MessageInterfaceFactory.LoggerInterface of(javax.annotation.processing.ProcessingEnvironment processingEnv)
-
extendsLoggerInterface
public boolean extendsLoggerInterface()
Description copied from interface:MessageInterface
Checks the interface to see if thelogger interface
is being extended in this interface.- Specified by:
extendsLoggerInterface
in interfaceMessageInterface
- Returns:
true
if this interface extends the logger interface, otherwisefalse
.
-
extendedInterfaces
public java.util.Set<MessageInterface> extendedInterfaces()
Description copied from interface:MessageInterface
A set of qualified interface names this interface extends or an empty set.- Specified by:
extendedInterfaces
in interfaceMessageInterface
- Returns:
- a set of interface names or an empty set.
-
methods
public java.util.Collection<MessageMethod> methods()
Description copied from interface:MessageInterface
A collection of all the methods this interface needs to implement.- Specified by:
methods
in interfaceMessageInterface
- Returns:
- a collection of methods.
-
projectCode
public java.lang.String projectCode()
Description copied from interface:MessageInterface
The project code for the message interface ornull
if not annotated with@MessageBundle
or@MessageLogger
.- Specified by:
projectCode
in interfaceMessageInterface
- Returns:
- the project code or
null
if not annotated with@MessageBundle
or@MessageLogger
-
name
public java.lang.String name()
Description copied from interface:MessageInterface
The qualified name of the message interface.- Specified by:
name
in interfaceMessageInterface
- Returns:
- the qualified name.
-
packageName
public java.lang.String packageName()
Description copied from interface:MessageInterface
The package name of the message interface.- Specified by:
packageName
in interfaceMessageInterface
- Returns:
- the package name.
-
simpleName
public java.lang.String simpleName()
Description copied from interface:MessageInterface
The name of the interface without the package.- Specified by:
simpleName
in interfaceMessageInterface
- Returns:
- the simple interface name.
-
loggingFQCN
public java.lang.String loggingFQCN()
Description copied from interface:MessageInterface
The fully qualified class name to use for log methods. This will generally be the same result asMessageInterface.name()
.- Specified by:
loggingFQCN
in interfaceMessageInterface
- Returns:
- the fully qualified class name to use for logging.
-
validIdRanges
public java.util.List<ValidIdRange> validIdRanges()
Description copied from interface:MessageInterface
Returns a list ofvalid id ranges
.- Specified by:
validIdRanges
in interfaceMessageInterface
- Returns:
- a list of valid id ranges or an empty list
-
getIdLength
public int getIdLength()
Description copied from interface:MessageInterface
The length to pad the id with. A value of less than 0 indicates no padding.- Specified by:
getIdLength
in interfaceMessageInterface
- Returns:
- the length to pad the id with
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejavax.lang.model.element.Element
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in interfacejavax.lang.model.element.Element
- Overrides:
equals
in classjava.lang.Object
-
compareTo
public int compareTo(MessageInterface o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<MessageInterface>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getComment
public java.lang.String getComment()
Description copied from interface:JavaDocComment
The JavaDoc comments if available ornull
if there are no JavaDoc's present.- Specified by:
getComment
in interfaceJavaDocComment
- Returns:
- the JavaDoc comments or
null
.
-
getDelegate
public javax.lang.model.element.TypeElement getDelegate()
Description copied from interface:DelegatingElement
The element to delegate the default methods to.- Specified by:
getDelegate
in interfaceDelegatingElement
- Specified by:
getDelegate
in interfaceDelegatingTypeElement
- Returns:
- the delegate
-
-