org.eclipse.jst.ws.annotations.core
Class AnnotationsCore

java.lang.Object
  extended by org.eclipse.jst.ws.annotations.core.AnnotationsCore

public final class AnnotationsCore
extends java.lang.Object

Utility class for creating annotations and member value pairs.

Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.


Method Summary
static org.eclipse.jdt.core.dom.MemberValuePair createArrayMemberValuePair(org.eclipse.jdt.core.dom.AST ast, java.lang.String name, java.lang.Object[] values)
          Creates a new MemberValuePair with an ArrayInitializer value.
static org.eclipse.jdt.core.dom.ArrayInitializer createArrayValueLiteral(org.eclipse.jdt.core.dom.AST ast, java.lang.Object[] values)
          Creates a new ArrayInitializer.
static org.eclipse.jdt.core.dom.BooleanLiteral createBooleanLiteral(org.eclipse.jdt.core.dom.AST ast, boolean value)
          Creates a new BooleanLiteral.
static org.eclipse.jdt.core.dom.MemberValuePair createBooleanMemberValuePair(org.eclipse.jdt.core.dom.AST ast, java.lang.String name, java.lang.Boolean value)
          Creates a new MemberValuePair with a BooleanLiteral value.
static org.eclipse.jdt.core.dom.QualifiedName createEnumLiteral(org.eclipse.jdt.core.dom.AST ast, java.lang.String className, org.eclipse.jdt.core.IField enumConstant)
          Creates a new QualifiedName to represent an enum literal value.
static org.eclipse.jdt.core.dom.QualifiedName createEnumLiteral(org.eclipse.jdt.core.dom.AST ast, java.lang.String className, java.lang.Object value)
          Creates a new QualifiedName to represent an enum literal value.
static org.eclipse.jdt.core.dom.MemberValuePair createEnumMemberValuePair(org.eclipse.jdt.core.dom.AST ast, java.lang.String className, java.lang.String name, java.lang.Object value)
          Creates a new MemberValuePair with a Name value.
static org.eclipse.jdt.core.dom.MarkerAnnotation createMarkerAnnotation(org.eclipse.jdt.core.dom.AST ast, java.lang.String annotationName)
          Creates a new MarkerAnnotation.
static org.eclipse.jdt.core.dom.MemberValuePair createMemberValuePair(org.eclipse.jdt.core.dom.AST ast, java.lang.String name, org.eclipse.jdt.core.dom.Expression expression)
          Creates a new MemberValuePair.
static org.eclipse.jdt.core.dom.NormalAnnotation createNormalAnnotation(org.eclipse.jdt.core.dom.AST ast, java.lang.String annotationName, java.util.List<org.eclipse.jdt.core.dom.MemberValuePair> memberValuePairs)
          Creates a new NormalAnnotation.
static org.eclipse.jdt.core.dom.NumberLiteral createNumberLiteral(org.eclipse.jdt.core.dom.AST ast, java.lang.String value)
          Creates a new NumberLiteral.
static org.eclipse.jdt.core.dom.MemberValuePair createNumberMemberValuePair(org.eclipse.jdt.core.dom.AST ast, java.lang.String name, java.lang.String value)
          Creates a new MemberValuePair with a NumberLiteral value.
static org.eclipse.jdt.core.dom.SingleMemberAnnotation createSingleMemberAnnotation(org.eclipse.jdt.core.dom.AST ast, java.lang.String annotationName, org.eclipse.jdt.core.dom.Expression value)
          Creates a new SingleMemberAnnotation.
static org.eclipse.jdt.core.dom.StringLiteral createStringLiteral(org.eclipse.jdt.core.dom.AST ast, java.lang.String literalValue)
          Creates a new StringLiteral.
static org.eclipse.jdt.core.dom.MemberValuePair createStringMemberValuePair(org.eclipse.jdt.core.dom.AST ast, java.lang.String name, java.lang.String value)
          Creates a new MemberValuePair with a StringLiteral value.
static org.eclipse.jdt.core.dom.TypeLiteral createTypeLiteral(org.eclipse.jdt.core.dom.AST ast, java.lang.Class<?> value)
          Creates a new TypeLiteral.
static org.eclipse.jdt.core.dom.TypeLiteral createTypeLiteral(org.eclipse.jdt.core.dom.AST ast, java.lang.Object value)
          Creates a new TypeLiteral.
static org.eclipse.jdt.core.dom.TypeLiteral createTypeLiteral(org.eclipse.jdt.core.dom.AST ast, java.lang.String value)
          Creates a new TypeLiteral
static org.eclipse.jdt.core.dom.MemberValuePair createTypeMemberValuePair(org.eclipse.jdt.core.dom.AST ast, java.lang.String name, java.lang.Object value)
          Creates a new MemberValuePair with a TypeLiteral value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createNormalAnnotation

public static org.eclipse.jdt.core.dom.NormalAnnotation createNormalAnnotation(org.eclipse.jdt.core.dom.AST ast,
                                                                               java.lang.String annotationName,
                                                                               java.util.List<org.eclipse.jdt.core.dom.MemberValuePair> memberValuePairs)
Creates a new NormalAnnotation.

Parameters:
ast - the AST that will be used to create the annotation.
annotationName - the name of the annotation.
memberValuePairs - a list of MemberValuePair to add to the normal annotation.
Returns:
a normal annotation with the given member value pairs.

createSingleMemberAnnotation

public static org.eclipse.jdt.core.dom.SingleMemberAnnotation createSingleMemberAnnotation(org.eclipse.jdt.core.dom.AST ast,
                                                                                           java.lang.String annotationName,
                                                                                           org.eclipse.jdt.core.dom.Expression value)
Creates a new SingleMemberAnnotation.

Parameters:
ast - the AST that will be used to create the annotation.
annotationName - the name of the annotation.
value - the Expression to set as the single member annotation value.
Returns:
a single member annotation with the given value.

createMarkerAnnotation

public static org.eclipse.jdt.core.dom.MarkerAnnotation createMarkerAnnotation(org.eclipse.jdt.core.dom.AST ast,
                                                                               java.lang.String annotationName)
Creates a new MarkerAnnotation.

Parameters:
ast - the AST that will be used to create the annotation.
annotationName - the name of the annotation.
Returns:
a marker annotation.

createMemberValuePair

public static org.eclipse.jdt.core.dom.MemberValuePair createMemberValuePair(org.eclipse.jdt.core.dom.AST ast,
                                                                             java.lang.String name,
                                                                             org.eclipse.jdt.core.dom.Expression expression)
Creates a new MemberValuePair.

Parameters:
ast - the AST that will be used to create the member value pair.
name - the MemberValuePair "name".
expression - the Expression "value" of the member value pair.
Returns:
a new member value pair with the given name and value.

createStringMemberValuePair

public static org.eclipse.jdt.core.dom.MemberValuePair createStringMemberValuePair(org.eclipse.jdt.core.dom.AST ast,
                                                                                   java.lang.String name,
                                                                                   java.lang.String value)
Creates a new MemberValuePair with a StringLiteral value.

Parameters:
ast - the AST that will be used to create the member value pair.
name - the member value pair "name".
value - the String "value".
Returns:
a new member value pair with the given name and value.

createBooleanMemberValuePair

public static org.eclipse.jdt.core.dom.MemberValuePair createBooleanMemberValuePair(org.eclipse.jdt.core.dom.AST ast,
                                                                                    java.lang.String name,
                                                                                    java.lang.Boolean value)
Creates a new MemberValuePair with a BooleanLiteral value.

Parameters:
ast - the AST that will be used to create the member value pair.
name - the member value pair "name".
value - the Boolean "value".
Returns:
a new member value pair with the given name and value.

createNumberMemberValuePair

public static org.eclipse.jdt.core.dom.MemberValuePair createNumberMemberValuePair(org.eclipse.jdt.core.dom.AST ast,
                                                                                   java.lang.String name,
                                                                                   java.lang.String value)
Creates a new MemberValuePair with a NumberLiteral value.

Parameters:
ast - the AST that will be used to create the member value pair.
name - the member value pair "name".
value - the String "value" representing the number.
Returns:
a new member value pair with the given name and value.

createEnumMemberValuePair

public static org.eclipse.jdt.core.dom.MemberValuePair createEnumMemberValuePair(org.eclipse.jdt.core.dom.AST ast,
                                                                                 java.lang.String className,
                                                                                 java.lang.String name,
                                                                                 java.lang.Object value)
Creates a new MemberValuePair with a Name value.

Parameters:
ast - the AST that will be used to create the member value pair.
className - the enclosing class name.
name - the member value pair "name".
value - an object representing the enum value.
Returns:
a new member value pair with the given name and value.

createTypeMemberValuePair

public static org.eclipse.jdt.core.dom.MemberValuePair createTypeMemberValuePair(org.eclipse.jdt.core.dom.AST ast,
                                                                                 java.lang.String name,
                                                                                 java.lang.Object value)
Creates a new MemberValuePair with a TypeLiteral value.

Parameters:
ast - the AST that will be used to create the member value pair.
name - the member value pair "name".
value - an object representing the type value.
Returns:
a new member value pair with the given name and value.

createArrayMemberValuePair

public static org.eclipse.jdt.core.dom.MemberValuePair createArrayMemberValuePair(org.eclipse.jdt.core.dom.AST ast,
                                                                                  java.lang.String name,
                                                                                  java.lang.Object[] values)
Creates a new MemberValuePair with an ArrayInitializer value.

Parameters:
ast - the AST that will be used to create the member value pair.
name - the member value pair "name".
values - an array of Object values. Supports String, Boolean, Class values.
Returns:
a new member value pair with the given name and array of values.

createArrayValueLiteral

public static org.eclipse.jdt.core.dom.ArrayInitializer createArrayValueLiteral(org.eclipse.jdt.core.dom.AST ast,
                                                                                java.lang.Object[] values)
Creates a new ArrayInitializer.

Parameters:
ast - the AST that will be used to create the ArrayInitializer.
values - an array of Object values. Supports String, Boolean, Class values.
Returns:
a new srray initializer.

createEnumLiteral

public static org.eclipse.jdt.core.dom.QualifiedName createEnumLiteral(org.eclipse.jdt.core.dom.AST ast,
                                                                       java.lang.String className,
                                                                       java.lang.Object value)
Creates a new QualifiedName to represent an enum literal value.

Parameters:
ast - the AST that will be used to create the qualified name.
className - the fully qualified name of the enclosing class.
value - an object representing the enum value.
Returns:
a new qualified name.

createEnumLiteral

public static org.eclipse.jdt.core.dom.QualifiedName createEnumLiteral(org.eclipse.jdt.core.dom.AST ast,
                                                                       java.lang.String className,
                                                                       org.eclipse.jdt.core.IField enumConstant)
Creates a new QualifiedName to represent an enum literal value.

Parameters:
ast - the AST that will be used to create the qualified name.
className - the fully qualified name of the enclosing class.
enumConstant - a IField where isEnumConstant() is true.
Returns:
a new qualified name.
Throws:
org.eclipse.jdt.core.JavaModelException
Since:
1.1

createTypeLiteral

public static org.eclipse.jdt.core.dom.TypeLiteral createTypeLiteral(org.eclipse.jdt.core.dom.AST ast,
                                                                     java.lang.Object value)
Creates a new TypeLiteral.

Parameters:
ast - the AST that will be used to create the TypeLiteral.
value - a Class or a String from which to create the type literal.
Returns:
a new type literal or null it the value is not of type Class or String.

createTypeLiteral

public static org.eclipse.jdt.core.dom.TypeLiteral createTypeLiteral(org.eclipse.jdt.core.dom.AST ast,
                                                                     java.lang.Class<?> value)
Creates a new TypeLiteral.

Parameters:
ast - the AST that will be used to create the type literal.
value - the class value.
Returns:
a new type literal.

createTypeLiteral

public static org.eclipse.jdt.core.dom.TypeLiteral createTypeLiteral(org.eclipse.jdt.core.dom.AST ast,
                                                                     java.lang.String value)
Creates a new TypeLiteral

Parameters:
ast - the AST that will be used to create the type literal.
value - the name of the class.
Returns:
a new type literal.

createStringLiteral

public static org.eclipse.jdt.core.dom.StringLiteral createStringLiteral(org.eclipse.jdt.core.dom.AST ast,
                                                                         java.lang.String literalValue)
Creates a new StringLiteral.

Parameters:
ast - the AST that will be used to create the string literal.
literalValue - the string value.
Returns:
a new string literal.

createBooleanLiteral

public static org.eclipse.jdt.core.dom.BooleanLiteral createBooleanLiteral(org.eclipse.jdt.core.dom.AST ast,
                                                                           boolean value)
Creates a new BooleanLiteral.

Parameters:
ast - the AST that will be used to create the boolean literal.
value - the boolean value.
Returns:
a new boolean literal.

createNumberLiteral

public static org.eclipse.jdt.core.dom.NumberLiteral createNumberLiteral(org.eclipse.jdt.core.dom.AST ast,
                                                                         java.lang.String value)
Creates a new NumberLiteral.

Parameters:
ast - the AST that will be used to create the NumberLiteral.
value - the number value.
Returns:
a new number literal.