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

All Known Subinterfaces:
  JAbstractType, JAnnotation, JAnnotationType, JAnnotationTypeMember, JCompilationUnit, JEnum, JEnumConstant, JField, JImport, JInitializer, JMember, JMethod, JPackage, JType

All Known Implementing Classes:
  AbstractJNode, ASTJAbstractType, ASTJAnnotation, ASTJAnnotationType, ASTJAnnotationTypeMember, ASTJCompilationUnit, ASTJEnum, ASTJEnumConstant, ASTJField, ASTJImport, ASTJInitializer, ASTJMember, ASTJMethod, ASTJNode, ASTJPackage, ASTJType, JDOMJCompilationUnit, JDOMJField, JDOMJImport, JDOMJInitializer, JDOMJMember, JDOMJMethod, JDOMJNode, 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.

Since:
  2.2.0

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

Method Detail

### getName

    java.lang.String getName()

  Returns the name of this node.

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

### setName

    void setName(java.lang.String name)

  Sets the name of this node. If the name is used to match the nodes to be merged, it is highly recommended not to use this method.

  Parameters:
    `name` -
  Since:
    2.3.0
  See Also:
    `getQualifiedName()`

### getQualifiedName

    java.lang.String getQualifiedName()

  Returns the qualified name of this node. This value is not expected to change as the node is modified.

  Returns:
    the qualified name of this type

### getContents

    java.lang.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

    int getFlags()

  Returns the modifier flags for this node. The flags can be examined using class `FacadeFlags`.

### setFlags

    void setFlags(int flags)

  Sets the flags for this member. The flags can be examined using the `FacadeFlags` class.

  Parameters:
    `flags` - the flags

### getParent

    JNode getParent()

  Returns the parent of this node.

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

### getChildren

    java.util.List<JNode> 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.