JBoss Logging I18n Annotation Processor 1.0.3.Final-redhat-2

org.jboss.logging.processor.apt
Class AptHelperImpl

java.lang.Object
  extended by org.jboss.logging.processor.apt.AptHelperImpl
All Implemented Interfaces:
AptHelper

public class AptHelperImpl
extends Object
implements AptHelper

Date: 24.08.2011

Author:
James R. Perkins

Constructor Summary
AptHelperImpl()
           
 
Method Summary
 boolean hasMessageId(ExecutableElement method)
          Checks to see if the method has a message id.
 boolean inheritsMessageId(ExecutableElement method)
          Checks to see if the method should inherit the message id from a different method if applicable.
 String loggerMethod(Annotations.FormatType formatType)
          Returns the logger method name to use or an empty string if the method is not a logger method.
 String logLevel(ExecutableElement method)
          Returns the log level enum.
 Annotations.FormatType messageFormat(ExecutableElement method)
          Returns the method format type.
 int messageId(ExecutableElement method)
          Returns the message id.
 String messageValue(ExecutableElement method)
          Returns the message value for the method.
 String projectCode(TypeElement intf)
          The project code from the interface.
 String targetName(VariableElement param)
          Returns the target field or method name for the annotated parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AptHelperImpl

public AptHelperImpl()
Method Detail

messageFormat

public Annotations.FormatType messageFormat(ExecutableElement method)
Description copied from interface: AptHelper
Returns the method format type.

Specified by:
messageFormat in interface AptHelper
Parameters:
method - the method with the Message annotation.
Returns:
the format type of the message or null if the format type was not found.

projectCode

public String projectCode(TypeElement intf)
Description copied from interface: AptHelper
The project code from the interface.

Specified by:
projectCode in interface AptHelper
Parameters:
intf - the interface to find the project code on.
Returns:
the project code or null if one was not found.

hasMessageId

public boolean hasMessageId(ExecutableElement method)
Description copied from interface: AptHelper
Checks to see if the method has a message id.

Specified by:
hasMessageId in interface AptHelper
Parameters:
method - the method to check.
Returns:
true if the message id was found, otherwise false.

inheritsMessageId

public boolean inheritsMessageId(ExecutableElement method)
Description copied from interface: AptHelper
Checks to see if the method should inherit the message id from a different method if applicable.

Specified by:
inheritsMessageId in interface AptHelper
Parameters:
method - the method to check.
Returns:
true if the message id should be inherited, otherwise false.

messageId

public int messageId(ExecutableElement method)
Description copied from interface: AptHelper
Returns the message id.

Specified by:
messageId in interface AptHelper
Parameters:
method - the method to check.
Returns:
the message id or 0 if one was not found.

messageValue

public String messageValue(ExecutableElement method)
Description copied from interface: AptHelper
Returns the message value for the method.

Specified by:
messageValue in interface AptHelper
Parameters:
method - the method to check.
Returns:
the message for the method, if no method found null is returned.

loggerMethod

public String loggerMethod(Annotations.FormatType formatType)
Description copied from interface: AptHelper
Returns the logger method name to use or an empty string if the method is not a logger method.

Specified by:
loggerMethod in interface AptHelper
Parameters:
formatType - the format type for the method.
Returns:
the name of the logger method or an empty string.

logLevel

public String logLevel(ExecutableElement method)
Description copied from interface: AptHelper
Returns the log level enum. For example Logger.Level.INFO.

Specified by:
logLevel in interface AptHelper
Parameters:
method - the method used to determine the log method.
Returns:
the log level.

targetName

public String targetName(VariableElement param)
Description copied from interface: AptHelper
Returns the target field or method name for the annotated parameter. If the parameter is not annotated with either Annotations.field() or Annotations.property() an empty string should be returned.

If the parameter is annotated with Annotations.property(), the name should be prepended with set. For example a property name of value should return setValue.

If the annotation does not have a defined value, the parameter name should be returned.

Specified by:
targetName in interface AptHelper
Parameters:
param - the parameter to check for the annotation.
Returns:
the field, method name or an empty string.

JBoss Logging I18n Annotation Processor 1.0.3.Final-redhat-2

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.