Package spoon.support.compiler
Class VirtualFile
java.lang.Object
spoon.support.compiler.VirtualFile
- All Implemented Interfaces:
SpoonFile,SpoonResource
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the file content as a stream.char[]getContentChars(Environment env)Gets the file content as a char array, considering encoding or encoding provider.Gets the parent of this resource on the file system.getName()Gets the name of this resource.Gets the folder that contains this resource.getPath()Gets this resource path.booleanTells if this file is an actual file (not a virtual file that holds in-memory contents).booleanTells if this resource is an archive.booleanisFile()Tells if this resource is a file.booleanisJava()True if a Java source code file.toFile()Gets the corresponding file if possible (returns null if this resource does not correspond to any file on the filesystem).
-
Field Details
-
VIRTUAL_FILE_NAME
- See Also:
- Constant Field Values
-
-
Constructor Details
-
VirtualFile
-
VirtualFile
-
-
Method Details
-
getContent
Description copied from interface:SpoonFileGets the file content as a stream.- Specified by:
getContentin interfaceSpoonFile
-
getContentChars
Description copied from interface:SpoonFileGets the file content as a char array, considering encoding or encoding provider.- Specified by:
getContentCharsin interfaceSpoonFile
-
isJava
public boolean isJava()Description copied from interface:SpoonFileTrue if a Java source code file. -
getName
Description copied from interface:SpoonResourceGets the name of this resource.- Specified by:
getNamein interfaceSpoonResource
-
getParent
Description copied from interface:SpoonResourceGets the folder that contains this resource.- Specified by:
getParentin interfaceSpoonResource
-
getFileSystemParent
Description copied from interface:SpoonResourceGets the parent of this resource on the file system.- Specified by:
getFileSystemParentin interfaceSpoonResource
-
getPath
Description copied from interface:SpoonResourceGets this resource path.- Specified by:
getPathin interfaceSpoonResource
-
isFile
public boolean isFile()Description copied from interface:SpoonResourceTells if this resource is a file.- Specified by:
isFilein interfaceSpoonResource
-
isArchive
public boolean isArchive()Description copied from interface:SpoonResourceTells if this resource is an archive.- Specified by:
isArchivein interfaceSpoonResource
-
toFile
Description copied from interface:SpoonResourceGets the corresponding file if possible (returns null if this resource does not correspond to any file on the filesystem).- Specified by:
toFilein interfaceSpoonResource
-
isActualFile
public boolean isActualFile()Description copied from interface:SpoonFileTells if this file is an actual file (not a virtual file that holds in-memory contents).- Specified by:
isActualFilein interfaceSpoonFile- Returns:
-