|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IClassFile
Represents an entire non-editable JavaScript file.
non-editable JavaScript file elements need to be opened before they can be navigated.
If a file cannot be parsed, its structure remains unknown. Use
IJavaScriptElement.isStructureKnown
to determine whether this is the
case.
This interface is not intended to be implemented by clients.
Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.
Field Summary |
---|
Fields inherited from interface org.eclipse.wst.jsdt.core.IJavaScriptElement |
---|
CLASS_FILE, FIELD, IMPORT_CONTAINER, IMPORT_DECLARATION, INITIALIZER, JAVASCRIPT_MODEL, JAVASCRIPT_PROJECT, JAVASCRIPT_UNIT, LOCAL_VARIABLE, METHOD, PACKAGE_DECLARATION, PACKAGE_FRAGMENT, PACKAGE_FRAGMENT_ROOT, TYPE, TYPE_PARAMETER |
Method Summary | |
---|---|
IJavaScriptUnit |
becomeWorkingCopy(IProblemRequestor problemRequestor,
WorkingCopyOwner owner,
IProgressMonitor monitor)
Deprecated. Use ITypeRoot.getWorkingCopy(WorkingCopyOwner, IProgressMonitor) instead.
Note that if this deprecated method is used, problems will be reported to the given problem requestor
as well as the problem requestor returned by the working copy owner (if not null). |
byte[] |
getBytes()
Returns the bytes contained in this file. |
IType |
getType()
Returns the first type contained in this file. |
IType[] |
getTypes()
|
boolean |
isClass()
|
boolean |
isInterface()
Returns whether this type represents an interface. |
Methods inherited from interface org.eclipse.wst.jsdt.core.ITypeRoot |
---|
findPrimaryType, getElementAt, getWorkingCopy |
Methods inherited from interface org.eclipse.wst.jsdt.core.IJavaScriptElement |
---|
exists, getAncestor, getAttachedJavadoc, getCommonSuperType, getCorrespondingResource, getDisplayName, getElementName, getElementType, getHandleIdentifier, getHostPath, getJavaScriptModel, getJavaScriptProject, getOpenable, getParent, getPath, getPrimaryElement, getResource, getSchedulingRule, getUnderlyingResource, isReadOnly, isStructureKnown, isVirtual |
Methods inherited from interface org.eclipse.wst.jsdt.core.ILookupScope |
---|
newNameLookup, newNameLookup, newSearchableNameEnvironment, newSearchableNameEnvironment |
Methods inherited from interface org.eclipse.wst.jsdt.core.IParent |
---|
getChildren, hasChildren |
Methods inherited from interface org.eclipse.wst.jsdt.core.IOpenable |
---|
close, findRecommendedLineSeparator, getBuffer, hasUnsavedChanges, isConsistent, isOpen, makeConsistent, open, save |
Methods inherited from interface org.eclipse.wst.jsdt.core.ISourceReference |
---|
exists, getSource, getSourceRange |
Methods inherited from interface org.eclipse.wst.jsdt.core.ICodeAssist |
---|
codeComplete, codeComplete, codeSelect, codeSelect |
Methods inherited from interface org.eclipse.wst.jsdt.core.IFunctionContainer |
---|
getField, getFields, getFunction, getFunctions, getMethods, getType |
Method Detail |
---|
IJavaScriptUnit becomeWorkingCopy(IProblemRequestor problemRequestor, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaScriptModelException
ITypeRoot.getWorkingCopy(WorkingCopyOwner, IProgressMonitor)
instead.
Note that if this deprecated method is used, problems will be reported to the given problem requestor
as well as the problem requestor returned by the working copy owner (if not null).
IBuffer
is
created using the given owner. Uses the primary owner if null
is
specified.
When switching to working copy mode, problems are reported to the given
IProblemRequestor
. Note that once in working copy mode, the given
IProblemRequestor
is ignored. Only the original IProblemRequestor
is used to report subsequent problems.
Once in working copy mode, changes to this working copy or its children are done in memory. Only the new buffer is affected.
Using IJavaScriptUnit.commitWorkingCopy(boolean, IProgressMonitor)
on the working copy
will throw a JavaScriptModelException
as a file is implicitly read-only.
If this file was already in working copy mode, an internal counter is incremented and no
other action is taken on this working copy. To bring this working copy back into the original mode
(where it reflects the underlying resource), IJavaScriptUnit.discardWorkingCopy()
must be call as many
times as becomeWorkingCopy(IProblemRequestor, WorkingCopyOwner, IProgressMonitor)
.
The primary javaScript unit of a file's working copy does not exist if the file is not
in working copy mode (classFileWorkingCopy.getPrimary().exists() == false
).
problemRequestor
- a requestor which will get notified of problems detected during
reconciling as they are discovered. The requestor can be set to null
indicating
that the client is not interested in problems.owner
- the given WorkingCopyOwner
, or null
for the primary ownermonitor
- a progress monitor used to report progress while opening this compilation unit
or null
if no progress should be reported
JavaScriptModelException
- if this javaScript unit could not become a working copy.IJavaScriptUnit.discardWorkingCopy()
byte[] getBytes() throws JavaScriptModelException
JavaScriptModelException
- if this element does not exist or if an
exception occurs while accessing its corresponding resourceIType getType()
IType[] getTypes() throws JavaScriptModelException
JavaScriptModelException
boolean isClass() throws JavaScriptModelException
JavaScriptModelException
boolean isInterface() throws JavaScriptModelException
true
if the file represents an interface.
JavaScriptModelException
- if this element does not exist or if an
exception occurs while accessing its corresponding resource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |