Extension SDK

oracle.jdeveloper.jot
Interface JotElement

All Known Subinterfaces:
JotAllocation, JotAnonymousClass, JotArrayAllocation, JotArrayDereference, JotArrayInitializer, JotAssignment, JotBlockElement, JotBlockStatement, JotBreak, JotCase, JotCatch, JotClass, JotClassAllocation, JotClassInitializer, JotCodeBlock, JotConditional, JotConstructor, JotContinue, JotDo, JotElse, JotExpression, JotExpressionStatement, JotField, JotFieldDeclaration, JotFile, JotFileElement, JotFor, JotForInitializer, JotHasChildStatement, JotIf, JotImport, JotInfixExpression, JotInnerClass, JotLocalClass, JotLocalVariable, JotLocalVariableDeclaration, JotMember, JotMethod, JotMethodCall, JotModel, JotNestedExpression, JotParameter, JotPostIncrementOrDecrement, JotPreIncrementOrDecrement, JotPrimaryExpression, JotQuestionExpression, JotReturn, JotStatement, JotStatementExpression, JotSwitch, JotSynchronized, JotThrow, JotTry, JotTypecast, JotUnaryExpression, JotVariable, JotVariableDeclaration, JotWhile, JotWorkArea
All Known Implementing Classes:
JotManager

public interface JotElement

A JotElement is a handle to its corresponding element in the Java Object Tree. A JotElement provides common interfaces for all elements in the Java Object Tree.

Methods that require the underlying element to exist throw a JotException. isExistant() can be used to determine if the element exists beforehand.

This interface is not intended to be implemented by clients.

Since:
5.0

Method Summary
 java.lang.String getElementName()
          Returns the name of this element.
 int getElementType()
          Returns this element's type as an integer.
 int getEndOffset()
          This method exists for historical reasons.
 java.lang.String getID()
          Returns a string representation of this element as a handle.
 JotWorkArea getJotWorkArea()
          Retrieves the JotWorkArea which contains this element, or null if no JotWorkArea contains this node.
 JotElement getParent()
          Returns the element directly containing this element, or null if this element has no parent.
 int getStartOffset()
          This method exists for historical reasons.
 boolean isExistent()
          Determines whether this JotElement currently exists in the model.
 boolean isReadOnly()
          Returns whether this JotElement is read-only.
 boolean isStructureKnown()
          Determines whether or not the contents of this element are knowable.
 void setParent(JotElement element)
          Sets the parent of this element.
 

Method Detail

getStartOffset

public int getStartOffset()
This method exists for historical reasons. Elements to which this method does not apply simply return -1. For example, elements like JotWorkAreas that are beyond the scope of a single file, or elements contained in class files or preparsed library files.

Retreives the starting offset of this element in the sourcefile. The value '-1' is returned if the element is not an existing element in the file, the element does not come from a source file, or the element is a JotFile.

Returns:
the starting offset of this element in its corresponding source file, or -1 if the element does not correspond to an entry in the file.

getEndOffset

public int getEndOffset()
This method exists for historical reasons. Elements to which this method does not apply simply return -1. For example, elements like JotWorkAreas that are beyond the scope of a single file, or elements contained in class files or preparsed library files.

Retreives the ending offset of this element in the sourcefile. The value '-1' is returned if the element is not an existing element in the file, the element does not come from a source file, or the element is a JotFile.

Returns:
the ending offset of this element in its corresponding source file, or -1 if the element does not correspond to an entry in the file.

isExistent

public boolean isExistent()
Determines whether this JotElement currently exists in the model. As elements to not represent the actual elements found in the tree, there may be occasion where a client has maintained an old or invalid element.

Returns:
true if this element exists in the JotModel.

isReadOnly

public boolean isReadOnly()
Returns whether this JotElement is read-only. The Jot only permits elements to be written to if their underlying resource is specifically opened in the environment or contined by the project, or super-project of this element explicitely, and the resource is not also read-only

Returns:
true if this element is read-only.

getElementName

public java.lang.String getElementName()
Returns the name of this element.

Returns:
the name of this element.

getElementType

public int getElementType()
Returns this element's type as an integer. The integer corresponds to one of the constants declared in JotElement

Returns:
the type of element;

getID

public java.lang.String getID()
Returns a string representation of this element as a handle. This string identifier is consistent across JDeveloper sessions and can be used to recreate the element, if its corresponding model element still exists in the parent, by calling Jot.create(java.lang.String).

Returns:
the string handle identifier

getParent

public JotElement getParent()
Returns the element directly containing this element, or null if this element has no parent.

Returns:
the parent element, or null if this element has no parent.

setParent

public void setParent(JotElement element)
Sets the parent of this element.


getJotWorkArea

public JotWorkArea getJotWorkArea()
Retrieves the JotWorkArea which contains this element, or null if no JotWorkArea contains this node.

Returns:
the JotWorkArea which contains this element, or null if no JotWorkArea contains this element.

isStructureKnown

public boolean isStructureKnown()
                         throws JotException
Determines whether or not the contents of this element are knowable. If the portion of the resource containing this element cannot be parsed at the moment, then isStructureKnown will return false.

Returns:
true if the structure is known.
Throws:
JotException

Extension SDK

 

Copyright ©1997, 2003, Oracle. All rights reserved.