Top Description Methods
org.eclipse.xtend.lib.macro.declaration

public Interface MutableTypeDeclaration

extends MutableMemberDeclaration, TypeDeclaration
Known Direct Subinterfaces
org.eclipse.xtend.lib.macro.declaration.MutableInterfaceDeclaration, org.eclipse.xtend.lib.macro.declaration.MutableAnnotationTypeDeclaration, org.eclipse.xtend.lib.macro.declaration.MutableClassDeclaration, org.eclipse.xtend.lib.macro.declaration.MutableEnumerationTypeDeclaration
Annotations
@Beta
Imports
org.eclipse.xtext.xbase.lib.Procedures, com.google.common.annotations.Beta

A mutable type declaration.
Author
Sven Efftinge

Method Summary

Modifier and TypeMethod and Description
public MutableConstructorDeclaration

Returns:

the created constructor declaration
addConstructor
(Procedures.Procedure1<MutableConstructorDeclaration>
a call back for further initialization of the constructor
initializer
)

Adds a new constructor to this type declaration.

public MutableFieldDeclaration

Returns:

the created field declaration
addField
(String
the name of the field to be added, must be not null
name
,
Procedures.Procedure1<MutableFieldDeclaration>
a callback for further initialization of the created field, must be not null
initializer
)

Adds a new field with the given name.

public MutableMethodDeclaration

Returns:

the created method declaration
addMethod
(String
the name of the method
name
,
Procedures.Procedure1<MutableMethodDeclaration>
a call back for further initialization of the method
initializer
)

Adds a new method with the given name to this type declaration.

public MutableConstructorDeclaration
public MutableFieldDeclaration
public MutableMethodDeclaration
public MutableTypeDeclaration
public Iterable<? extends MutableAnnotationTypeDeclaration>
public Iterable<? extends MutableClassDeclaration>
public Iterable<? extends MutableConstructorDeclaration>
public Iterable<? extends MutableEnumerationTypeDeclaration>
public Iterable<? extends MutableFieldDeclaration>
public Iterable<? extends MutableInterfaceDeclaration>
public Iterable<? extends MutableMemberDeclaration>
public Iterable<? extends MutableMethodDeclaration>
public Iterable<? extends MutableTypeDeclaration>
public void
remove()

Redeclares org.eclipse.xtend.lib.macro.declaration.MutableElement.remove.

It is not possible to remove a type.

public void
setSimpleName(String simpleName)

Redeclares org.eclipse.xtend.lib.macro.declaration.MutableNamedElement.setSimpleName.

It is not possible to rename a type.

Inherited from org.eclipse.xtend.lib.macro.declaration.MutableMemberDeclaration:
getDeclaringTypesetDeprecatedsetDocCommentsetVisibility

Method Detail

addConstructorback to summary
public MutableConstructorDeclaration addConstructor(Procedures.Procedure1<MutableConstructorDeclaration> initializer)

Adds a new constructor to this type declaration.

Parameters
initializer:Procedures.Procedure1<MutableConstructorDeclaration>

a call back for further initialization of the constructor

Returns:MutableConstructorDeclaration

the created constructor declaration

Exceptions
UnsupportedOperationException:
if the underlying type declaration is not capable of containing constructors.
IllegalArgumentException:
if the initializer is null
addFieldback to summary
public MutableFieldDeclaration addField(String name, Procedures.Procedure1<MutableFieldDeclaration> initializer)

Adds a new field with the given name.

Parameters
name:String

the name of the field to be added, must be not null

initializer:Procedures.Procedure1<MutableFieldDeclaration>

a callback for further initialization of the created field, must be not null

Returns:MutableFieldDeclaration

the created field declaration

Exceptions
UnsupportedOperationException:
if the underlying type declaration is not capable of containing methods.
IllegalArgumentException:
if the name is not a valid java identifier or the initializer is null
addMethodback to summary
public MutableMethodDeclaration addMethod(String name, Procedures.Procedure1<MutableMethodDeclaration> initializer)

Adds a new method with the given name to this type declaration.

Parameters
name:String

the name of the method

initializer:Procedures.Procedure1<MutableMethodDeclaration>

a call back for further initialization of the method

Returns:MutableMethodDeclaration

the created method declaration

Exceptions
UnsupportedOperationException:
if the underlying type declaration is not capable of containing methods.
IllegalArgumentException:
if the name is not a valid java identifier or the initializer is null
findDeclaredConstructorback to summary
public MutableConstructorDeclaration findDeclaredConstructor(TypeReference... parameterTypes)

Redeclares org.eclipse.xtend.lib.macro.declaration.TypeDeclaration.findDeclaredConstructor.

findDeclaredFieldback to summary
public MutableFieldDeclaration findDeclaredField(String name)

Redeclares org.eclipse.xtend.lib.macro.declaration.TypeDeclaration.findDeclaredField.

findDeclaredMethodback to summary
public MutableMethodDeclaration findDeclaredMethod(String name, TypeReference... parameterTypes)

Redeclares org.eclipse.xtend.lib.macro.declaration.TypeDeclaration.findDeclaredMethod.

findDeclaredTypeback to summary
public MutableTypeDeclaration findDeclaredType(String name)

Redeclares org.eclipse.xtend.lib.macro.declaration.TypeDeclaration.findDeclaredType.

Since
2.8
getDeclaredAnnotationTypesback to summary
public Iterable<? extends MutableAnnotationTypeDeclaration> getDeclaredAnnotationTypes()

Redeclares org.eclipse.xtend.lib.macro.declaration.TypeDeclaration.getDeclaredAnnotationTypes.

Since
2.8
getDeclaredClassesback to summary
public Iterable<? extends MutableClassDeclaration> getDeclaredClasses()

Redeclares org.eclipse.xtend.lib.macro.declaration.TypeDeclaration.getDeclaredClasses.

getDeclaredConstructorsback to summary
public Iterable<? extends MutableConstructorDeclaration> getDeclaredConstructors()

Redeclares org.eclipse.xtend.lib.macro.declaration.TypeDeclaration.getDeclaredConstructors.

getDeclaredEnumerationTypesback to summary
public Iterable<? extends MutableEnumerationTypeDeclaration> getDeclaredEnumerationTypes()

Redeclares org.eclipse.xtend.lib.macro.declaration.TypeDeclaration.getDeclaredEnumerationTypes.

Since
2.8
getDeclaredFieldsback to summary
public Iterable<? extends MutableFieldDeclaration> getDeclaredFields()

Redeclares org.eclipse.xtend.lib.macro.declaration.TypeDeclaration.getDeclaredFields.

getDeclaredInterfacesback to summary
public Iterable<? extends MutableInterfaceDeclaration> getDeclaredInterfaces()

Redeclares org.eclipse.xtend.lib.macro.declaration.TypeDeclaration.getDeclaredInterfaces.

getDeclaredMembersback to summary
public Iterable<? extends MutableMemberDeclaration> getDeclaredMembers()

Redeclares org.eclipse.xtend.lib.macro.declaration.TypeDeclaration.getDeclaredMembers.

getDeclaredMethodsback to summary
public Iterable<? extends MutableMethodDeclaration> getDeclaredMethods()

Redeclares org.eclipse.xtend.lib.macro.declaration.TypeDeclaration.getDeclaredMethods.

getDeclaredTypesback to summary
public Iterable<? extends MutableTypeDeclaration> getDeclaredTypes()

Redeclares org.eclipse.xtend.lib.macro.declaration.TypeDeclaration.getDeclaredTypes.

Since
2.8
removeback to summary
public void remove()

Redeclares org.eclipse.xtend.lib.macro.declaration.MutableElement.remove.

It is not possible to remove a type.

Exceptions
UnsupportedOperationException:
always
setSimpleNameback to summary
public void setSimpleName(String simpleName)

Redeclares org.eclipse.xtend.lib.macro.declaration.MutableNamedElement.setSimpleName.

It is not possible to rename a type.

Exceptions
UnsupportedOperationException:
always