org.eclipse.emf.codegen.merge.java.facade
Interface JNode

All Known Subinterfaces:
JCompilationUnit, JField, JImport, JInitializer, JMember, JMethod, JPackage, JType
All Known Implementing Classes:
AbstractJNode, ASTJCompilationUnit, ASTJField, ASTJImport, ASTJInitializer, ASTJMember, ASTJMethod, ASTJPackage, ASTJType, JDOMJCompilationUnit, JDOMJField, JDOMJImport, JDOMJInitializer, JDOMJMember, JDOMJMethod, JDOMJPackage, JDOMJType

public interface JNode

Represents an entire Java compilation unit (.java source file). Compilation unit elements need to be opened before they can be navigated. The children are of type JPackage, JImport, and JType, and appear in the order in which they are declared in the source. If a .java file cannot be parsed, its structure remains unknown. Use JNode#isStructureKnown to determine whether this is the case.

Since:
2.2.0

Method Summary
 List getChildren()
          Returns the children of this node.
 String getContents()
          Returns the current contents of this document fragment.
 int getFlags()
          Returns the modifier flags for this node.
 String getName()
          Returns the name of this node.
 JNode getParent()
          Returns the parent of this node.
 String getQualifiedName()
          Returns the qualified name of this node.
 void setFlags(int flags)
          Sets the flags for this member.
 

Method Detail

getName

public String getName()
Returns the name of this node.

Returns:
the name, or null if it has no name

getQualifiedName

public String getQualifiedName()
Returns the qualified name of this node.

Returns:
the qualified name of this type

getContents

public String getContents()
Returns the current contents of this document fragment.

Note: To obtain complete source for the ".java" file, ask a compilation unit node for its contents.

Returns:
the contents, or null if this node has no contents

getFlags

public int getFlags()
Returns the modifier flags for this node. The flags can be examined using class FacadeFlags.


setFlags

public void setFlags(int flags)
Sets the flags for this member. The flags can be examined using the FacadeFlags class.

Parameters:
flags - the flags

getParent

public JNode getParent()
Returns the parent of this node.

Returns:
the parent node, or null if this node does not have a parent

getChildren

public List getChildren()
Returns the children of this node. Returns an empty list if this node has no children (including nodes that cannot have children). Children appear in the order in which they are declared in the source code.

The list must be unmodifiable if the implementation doesn't support direct manipulation.

Returns:
a list of the children

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