JavaImport Class

com.bea.ide.lang.java.element
JavaImport Class

public class JavaImport

    extends JavaElement

Java is a DefaultSourceElement derivation that represents a top-level class or package import.

JavaArgument objects generally do not have any children.

The properties available on an object of this type may be found by looking at the getDefaultPropertyDescriptors method.

All java parse tree objects are instantiated as part of parse tree construction by the JavaBuilder class.


Hierarchy
Object
  DefaultElement
    DefaultTreeElement
      DefaultDocumentElement
        DefaultSourceElement
          JavaElement
            JavaImport
All Implemented Interfaces

IDocumentElement, IElement, ISourceElement, IStructureFeature.IStructureNode, ITreeElement

Nested Class Summary

 
Nested classes from  com.bea.ide.sourceeditor.element.DefaultSourceElement
DefaultSourceElement.CompilerPropertyDescriptor, DefaultSourceElement.DefaultAuthorElement, DefaultSourceElement.StaticCompilerPropertyDescriptor, DefaultSourceElement.StickyRange
 

Field Summary

public static final String
PROP_ONDEMAND
Property key for the on-demand property of JavaImport objects.
   
Fields from  com.bea.ide.sourceeditor.element.DefaultSourceElement
_range, PROP_NAME, PROP_VALUE
 
Fields from  com.bea.ide.element.DefaultTreeElement
_parent, _vChildren
 
Fields from interface com.bea.ide.sourceeditor.element.ISourceElement
STATUS_IN_TREE, STATUS_NOT_IN_TREE, STATUS_REMOVED_FROM_TREE
 

Constructor Summary

JavaImport()

Creates a new object containing a null cookie.
JavaImport(Object compilerCookie)

Creates a new object containing the specified cookie.
 

Method Summary

public DefaultSourceElement.CompilerPropertyDescriptor[]
getDefaultPropertyDescriptors()
Objects of this type define the following properties:
JavaImport.PROP_NAME: the name of the class/package being imported.
public boolean
getImportOnDemand()
Gets the 'import-on-demand' property for this JavaImport.
public String
getName()
Gets the Name of the package/class specified by this JavaImport
public IStructureFeature.StructureCode
getTypeCode()
This method returns a code used by the compiler to identify the type of this element.
public void
setImportOnDemand(boolean newboolean)
Sets the 'import-on-demand' property for this JavaImport.
public void
setName(String newString)
Sets the Name of the package specified by this JavaImport.
public String
toString()
Stringify by returning my name
public Object
visit(JavaVisitor v, Object arg)
Provides JavaVisitor support for this element type.
 
Methods from  com.bea.ide.sourceeditor.element.DefaultSourceElement
addChild, createAuthorNode, debugDump, equals, getChildrenByClass, getClassLoader, getCookie, getDiagnostics, getGroup, getInstanceName, getProperty, getPropertyCode, getPropertyDescriptors, getPropertySourceRange, getPropertySourceRanges, getPropertySourceText, getPropertySourceText, getRange, getRange, getRangePrefetchProperties, getStatus, initializeRange, initializeRange, insertChild, isAuthorProperty, markRemovedFromTree, mergeElements, mergeFrom, propertyModified, removeChild, removeChild, replaceChild, requestAddChild, requestAddChild, requestRemoveChild, requestSetProperty, setProperty, setStatus
 
Methods from  com.bea.ide.document.DefaultDocumentElement
addChild, getDocument, setDocument
 
Methods from  com.bea.ide.element.DefaultTreeElement
addChild, children, getChild, getChildCount, getParent, removeChild
 
Methods from  com.bea.ide.element.DefaultElement
getProperty, getPropertyDescriptors, setProperty
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
   
Methods from interface com.bea.ide.document.IDocumentElement
getDocument
 
Methods from interface com.bea.ide.element.IElement
getProperty, getPropertyDescriptors, setProperty
 
Methods from interface com.bea.ide.sourceeditor.element.ISourceElement
createAuthorNode, getCookie, getDiagnostics, getPropertyCode, getRange, getStatus, mergeFrom, requestAddChild, requestAddChild, requestRemoveChild, requestSetProperty
 
Methods from interface com.bea.compiler.feature.IStructureFeature.IStructureNode
getCookie, getTypeCode
 
Methods from interface com.bea.ide.element.ITreeElement
children, getChild, getChildCount, getParent
 

Field Detail

PROP_ONDEMAND

public static final String PROP_ONDEMAND
Property key for the on-demand property of JavaImport objects.

 

Constructor Detail

JavaImport

public JavaImport()
Creates a new object containing a null cookie. This constructor should be used by callers constructing objects that are not part of an active parse tree, such as those to be added via two-way edit.

JavaImport

public JavaImport(Object compilerCookie)
Creates a new object containing the specified cookie. This constructor should only be called by ILanguageBuilder implementations.
 

Method Detail

getDefaultPropertyDescriptors() Method

public DefaultSourceElement.CompilerPropertyDescriptor[] getDefaultPropertyDescriptors()
Objects of this type define the following properties:
JavaImport.PROP_NAME: the name of the class/package being imported.
JavaImport.PROP_ONDEMAND: whether this import takes place 'on demand'. See compiler documentation for more information.

Additionally, all DefaultSourceElement derivations also inherit all properties returned by getDefaultPropertyDescriptors from all super classes.

Overrides
DefaultSourceElement.getDefaultPropertyDescriptors()

Returns

an array of CompilerPropertyDescriptor objects

getImportOnDemand() Method

public boolean getImportOnDemand()
Gets the 'import-on-demand' property for this JavaImport.


getName() Method

public String getName()
Gets the Name of the package/class specified by this JavaImport


getTypeCode() Method

public IStructureFeature.StructureCode getTypeCode()
This method returns a code used by the compiler to identify the type of this element. This method should not be called directly, since the return value isn't useful outside of the compiler.

Overrides
DefaultSourceElement.getTypeCode()

Returns

A compiler structure code identifying the type of this element.

setImportOnDemand(boolean) Method

public void setImportOnDemand(boolean newboolean)
Sets the 'import-on-demand' property for this JavaImport.


setName(String) Method

public void setName(String newString)
Sets the Name of the package specified by this JavaImport.


toString() Method

public String toString()
Stringify by returning my name

Overrides
Object.toString()

visit(JavaVisitor, Object) Method

public Object visit(JavaVisitor v, 
                    Object arg)
Provides JavaVisitor support for this element type.

Overrides
JavaElement.visit(JavaVisitor, Object)

Parameters

v
The visitor
arg
An argument to the visit, to be interpreted by the visitor.

Returns

Object returned by the visitor.