JavaScript Development Tools
Release 3.2

org.eclipse.wst.jsdt.core
Interface IClassFile

All Superinterfaces:
ICodeAssist, IFunctionContainer, IJavaScriptElement, ILookupScope, IOpenable, IParent, ISourceReference, ITypeRoot

public interface IClassFile
extends ITypeRoot

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_FRAGMENT, PACKAGE_FRAGMENT_ROOT, TYPE
 
Method Summary
 byte[] getBytes()
          Returns the bytes contained in this file.
 IType getType()
          Returns the first type contained in this file.
 IType[] getTypes()
           
 boolean isClass()
           
 
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, getType
 

Method Detail

getBytes

byte[] getBytes()
                throws JavaScriptModelException
Returns the bytes contained in this file.

Returns:
the bytes contained in this file
Throws:
JavaScriptModelException - if this element does not exist or if an exception occurs while accessing its corresponding resource

getType

IType getType()
Returns the first type contained in this file. This is a handle-only method. The type may or may not exist.

Returns:
the type contained in this file

getTypes

IType[] getTypes()
                 throws JavaScriptModelException
Throws:
JavaScriptModelException

isClass

boolean isClass()
                throws JavaScriptModelException
Throws:
JavaScriptModelException

JavaScript Development Tools
Release 3.2

Copyright (c) IBM Corp. and others 2000, 2010. All Rights Reserved.