com.togethersoft.openapi.sci
Interface SciFile


public interface SciFile
extends SciScope

Represents a file with source code, or compiled java class.


Method classes returns this file's content as an enumeration of upper-level classes
(inner classes are not included in the enumeration).


Method getContainingPackage returns a containing package for this file.



Qualified Name
Qualified name is an absolute pathname for this file. For example,


"C:\agent007\java\myClass.java"


It is returned by the getQualifiedName method.

Name
A string containing a short name of this file. For example,


"myClass.java"


It is returned by the getName method. It can be changed using the setName method.



A new file can be created by SciFactory or
SciGenericFactory objects.

Author:
TogetherSoft
Since: Together 3.0

Method Summary
 booleancanSetName(String name)
          Checks whether the specified string can be set as a name for this file.
 SciClassEnumerationclasses()
          Returns an enumeration of upper-level classes in this file.
 SciPackagegetContainingPackage()
          Returns the package this file belongs to.
 SciJavaImportListgetJavaImportList()
          Returns JavaImportList containing SciJavaImport instances.
 StringgetName()
          Returns a string with the name for this file.
 SciObjectgetObjectAtPosition(int offset)
          Reserved not implemeted yet.
 StringgetQualifiedName()
          Returns the qualified name string for this file.
 voidsetName(String name)
          Sets the name for this file.

Methods inherited from interface com.togethersoft.openapi.sci.SciScope
declaredElements, isDeleted, visitExpressions, visitExpressions, visitReferences, visitReferences, visitStatements, visitStatements

Methods inherited from interface com.togethersoft.openapi.sci.SciContainer
canPaste, objects, paste

Methods inherited from interface com.togethersoft.openapi.sci.SciObject
canCut, canDelete, canReplace, copy, cut, delete, getContainingFile, getContainingScope, getLanguage, getPositions, getText, getUserProperty, isReadOnly, replace, setUserProperty

Method Detail

canSetName

public boolean canSetName(String name)
Checks whether the specified string can be set as a name for this file.
Parameters:
name the string which needs to be assigned as a name to this file
Returns: true if the specified name can be set for this file, false otherwise

classes

public SciClassEnumeration classes()
Returns an enumeration of upper-level classes in this file. For accessing the information
about inner classes of an upper-level one, the innerClasses method should be used.
Returns: an enumeration of upper-level classes in this file
See Also:
SciClass.innerClasses()

getContainingPackage

public SciPackage getContainingPackage()
Returns the package this file belongs to.
Returns: the package this file belongs to

getJavaImportList

public SciJavaImportList getJavaImportList()
Returns JavaImportList containing SciJavaImport instances.
For Java language only.
Returns: JavaImportList containing SciJavaImport instances
See Also:
SciJavaImport, SciJavaImportList

getName

public String getName()
Returns a string with the name for this file.
Returns: a string with the name for this file

getObjectAtPosition

public SciObject getObjectAtPosition(int offset)
Reserved not implemeted yet.
Locates object at given position.
Since:
Together 6.0

getQualifiedName

public String getQualifiedName()
Returns the qualified name string for this file.
For SciFilees the qualified name is an absolute pathname to this file.
Returns: the qualified name string for this file

setName

public void setName(String name)
Sets the name for this file. For example:

SciFile f = SciModelAccess.getModel().getFactory(SciLanguage.JAVA).newFile();
f.setName("R.java"); //setting the name
someSciPackage.paste(f,null,false);
Parameters:
name the string which needs to be assigned as a name to this file