org.eclipse.emf.codegen.merge.java.facade.ast
Class ASTJType

java.lang.Object
  extended by org.eclipse.emf.codegen.merge.java.facade.AbstractJNode
      extended by org.eclipse.emf.codegen.merge.java.facade.ast.ASTJNode<T>
          extended by org.eclipse.emf.codegen.merge.java.facade.ast.ASTJMember<T>
              extended by org.eclipse.emf.codegen.merge.java.facade.ast.ASTJAbstractType<org.eclipse.jdt.core.dom.TypeDeclaration>
                  extended by org.eclipse.emf.codegen.merge.java.facade.ast.ASTJType
All Implemented Interfaces:
JAbstractType, JMember, JNode, JType

public class ASTJType
extends ASTJAbstractType<org.eclipse.jdt.core.dom.TypeDeclaration>
implements JType

Wraps TypeDeclaration object.

Since:
2.2.0

Field Summary
protected  java.util.List<java.lang.String> addedSuperInterfaces
          List of added interfaces by calling addSuperInterface(String).
protected  java.lang.String superclassName
          Cached super class name.
protected  java.lang.String[] superInterfaces
          Array of cached super interfaces.
protected  java.lang.String[] typeParameters
          Cached type parameters
 
Fields inherited from class org.eclipse.emf.codegen.merge.java.facade.ast.ASTJMember
comment
 
Fields inherited from class org.eclipse.emf.codegen.merge.java.facade.ast.ASTJNode
isCommentedOut, name, rewriter, UNITIALIZED_STRING
 
Fields inherited from class org.eclipse.emf.codegen.merge.java.facade.AbstractJNode
EMPTY_STRING_ARRAY, qualifiedName
 
Constructor Summary
protected ASTJType(org.eclipse.jdt.core.dom.TypeDeclaration abstractTypeDeclaration)
           
 
Method Summary
 void addSuperInterface(java.lang.String superInterface)
          Adds the given interface name to the names of interfaces that this type implements or extends (the name will be added after the existing interface names).
 void dispose()
           
 int getFlags()
          Returns the original flags of the type, including the FacadeFlags.INTERFACE flag.
 java.lang.String getSuperclass()
          Returns the name of this type's superclass.
 java.lang.String[] getSuperInterfaces()
          Returns the names of interfaces that this type implements or extends, in the order in which they are listed in the source, or an empty array if no super interfaces are present.
 java.lang.String[] getTypeParameters()
          Returns the formal type parameters for this type.
 void setSuperclass(java.lang.String superclassName)
          Sets the name of this type's superclass.
 void setSuperInterfaces(java.lang.String[] interfaceNames)
          Sets the names of interfaces that this type implements or extends, in the order in which they are to be listed in the source.
 void setTypeParameters(java.lang.String[] typeParameters)
          Sets the formal type parameters for this type.
 
Methods inherited from class org.eclipse.emf.codegen.merge.java.facade.ast.ASTJAbstractType
addChild, computeQualifiedName, getChildren, getMembers, getName, insertSibling, remove, setName
 
Methods inherited from class org.eclipse.emf.codegen.merge.java.facade.ast.ASTJMember
getAnnotationList, getComment, insertLastAnnotation, setComment, setFlags
 
Methods inherited from class org.eclipse.emf.codegen.merge.java.facade.ast.ASTJNode
addValueToListProperty, addValueToListProperty, ancestorInserted, ancestorToBeRemoved, childToBeChanged, combineArrayAndList, commentOut, convertASTNodeListToStringArray, disableTrackAndReplace, enableTrackAndReplace, getASTNode, getContents, getFacadeHelper, getParent, getRemovedASTNode, getRewriter, getWrappedObject, insert, insertFirst, insertLast, isDisposed, nodeToBeMoved, nodeToBeRemoved, remove, removeNodeFromListProperty, removeTrackAndReplace, setASTNode, setFacadeHelper, setListNodeProperty, setNodeProperty, setNodeProperty, setParent, setRemovedASTNode, setRewriter, setTrackedNodeProperty, setWrappedObject, trackAndReplace
 
Methods inherited from class org.eclipse.emf.codegen.merge.java.facade.AbstractJNode
computeQualifiedName, computeQualifiedName, computeQualifiedName, getName, getQualifiedName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.emf.codegen.merge.java.facade.JMember
getComment, setComment
 
Methods inherited from interface org.eclipse.emf.codegen.merge.java.facade.JNode
getChildren, getContents, getName, getParent, getQualifiedName, setFlags, setName
 

Field Detail

superclassName

protected java.lang.String superclassName
Cached super class name.

See Also:
getSuperclass(), setSuperclass(String)

superInterfaces

protected java.lang.String[] superInterfaces
Array of cached super interfaces. All currently set super interfaces is a combination of this array and addedSuperInterfaces.


addedSuperInterfaces

protected java.util.List<java.lang.String> addedSuperInterfaces
List of added interfaces by calling addSuperInterface(String). This list does not include existing interfaces, nor interfaces set by setSuperInterfaces(String[])


typeParameters

protected java.lang.String[] typeParameters
Cached type parameters

See Also:
getTypeParameters(), setTypeParameters(String[])
Constructor Detail

ASTJType

protected ASTJType(org.eclipse.jdt.core.dom.TypeDeclaration abstractTypeDeclaration)
Parameters:
abstractTypeDeclaration -
Method Detail

dispose

public void dispose()
Overrides:
dispose in class ASTJMember<org.eclipse.jdt.core.dom.TypeDeclaration>

getSuperclass

public java.lang.String getSuperclass()
Description copied from interface: JType
Returns the name of this type's superclass. The syntax for a superclass name is specified by Super in ClassDeclaration (JLS2 8.1). Type names must be specified as they would appear in source code. For example: "Object", or "java.io.File". As of J2SE 1.5, the superclass may also include parameterized types like "ArrayList<String>".

Specified by:
getSuperclass in interface JType
Returns:
the superclass name, or null if this type represents an interface or if no superclass has been assigned to this class

setSuperclass

public void setSuperclass(java.lang.String superclassName)
Description copied from interface: JType
Sets the name of this type's superclass. Has no effect if this type represents an interface. A null name indicates that no superclass name (extends clause) should appear in the source code. The syntax for a superclass name is specified by Super in ClassDeclaration (JLS2 8.1). Type names must be specified as they would appear in source code. For example: "Object", or "java.io.File". As of J2SE 1.5, the superclass may also include parameterized types like "ArrayList<String>".

Specified by:
setSuperclass in interface JType
Parameters:
superclassName - the superclass name, or null if this type should have to no explicitly specified superclass

getSuperInterfaces

public java.lang.String[] getSuperInterfaces()
Description copied from interface: JType
Returns the names of interfaces that this type implements or extends, in the order in which they are listed in the source, or an empty array if no super interfaces are present. The syntax for interface names is defined by Interfaces in ClassDeclaration (JLS2 8.1). Type names appear as they would in source code. For example: "Cloneable", or "java.io.Serializable". As of J2SE 1.5, super interfaces may also include parameterized types like "List<String>".

For classes, this method returns the interfaces that this class implements. For interfaces, this method returns the interfaces that this interface extends.

Specified by:
getSuperInterfaces in interface JType
Returns:
the list of interface names, or an empty array if no interfaces are declared

setSuperInterfaces

public void setSuperInterfaces(java.lang.String[] interfaceNames)
Description copied from interface: JType
Sets the names of interfaces that this type implements or extends, in the order in which they are to be listed in the source. An empty array parameter indicates that no super interfaces are present. The syntax for interface names is defined by Interfaces in ClassDeclaration (JLS2 8.1). Type names appear as they would in source code. For example: "Cloneable", or "java.io.Serializable". As of J2SE 1.5, super interfaces may also include parameterized types like "List<String>".

For classes, this method sets the interfaces that this class implements. For interfaces, this method sets the interfaces that this interface extends.

Specified by:
setSuperInterfaces in interface JType
Parameters:
interfaceNames - the list of interface names

addSuperInterface

public void addSuperInterface(java.lang.String superInterface)
Description copied from interface: JType
Adds the given interface name to the names of interfaces that this type implements or extends (the name will be added after the existing interface names). This is a convenience method. For classes, this represents the interfaces that this class implements. For interfaces, this represents the interfaces that this interface extends. The name may or may not be fully qualified.

Specified by:
addSuperInterface in interface JType
Parameters:
superInterface - the syntax for an interface name is defined by Interfaces in ClassDeclaration (JLS2 8.1). Type names must be specified as they would appear in source code. For example: "Cloneable", "java.io.Serializable".

getTypeParameters

public java.lang.String[] getTypeParameters()
Description copied from interface: JType
Returns the formal type parameters for this type. Returns an empty array if this method has no formal type parameters.

Formal type parameters are as they appear in the source code; for example: "X extends List<String> & Serializable".

Specified by:
getTypeParameters in interface JType
Returns:
the formal type parameters of this type, in the order declared in the source, or an empty array if no type parameters are declared

setTypeParameters

public void setTypeParameters(java.lang.String[] typeParameters)
Description copied from interface: JType
Sets the formal type parameters for this type.

Formal type parameters are given as they appear in the source code; for example: "X extends List<String> & Serializable".

Specified by:
setTypeParameters in interface JType
Parameters:
typeParameters - the formal type parameters of this type, in the order to appear in the source, an empty array if none

getFlags

public int getFlags()
Returns the original flags of the type, including the FacadeFlags.INTERFACE flag.

Note that the FacadeFlags.INTERFACE flag can not be set.

Specified by:
getFlags in interface JNode
Overrides:
getFlags in class ASTJMember<org.eclipse.jdt.core.dom.TypeDeclaration>
See Also:
ASTJMember.getFlags()

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.