Class StringResource
java.lang.Object
org.codehaus.commons.compiler.util.resource.StringResource
- All Implemented Interfaces:
Resource
-
Constructor Summary
ConstructorsConstructorDescriptionStringResource(String fileName, String text) Encodes the text with the platform default charset.StringResource(String fileName, String text, Charset charset) Encodes the text with the given charset, which should be the source charset of the compiler that reads the resource; seeICompiler.setSourceCharset(Charset). -
Method Summary
Modifier and TypeMethodDescriptionfinal StringReturns a decorative "file name" that can be used for reporting errors and the like.final longReturns the time of the last modification, in milliseconds since 1970, or0Lif the time of the last modification cannot be determined.final InputStreamopen()Opens the resource.final StringtoString()
-
Constructor Details
-
StringResource
-
StringResource
Encodes the text with the given charset, which should be the source charset of the compiler that reads the resource; seeICompiler.setSourceCharset(Charset).
-
-
Method Details
-
getFileName
Description copied from interface:ResourceReturns a decorative "file name" that can be used for reporting errors and the like. It does not necessarily map to a file in the local file system!- Specified by:
getFileNamein interfaceResource
-
open
Description copied from interface:ResourceOpens the resource. The caller is responsible for closing theInputStream. -
lastModified
public final long lastModified()Description copied from interface:ResourceReturns the time of the last modification, in milliseconds since 1970, or0Lif the time of the last modification cannot be determined.- Specified by:
lastModifiedin interfaceResource
-
toString
-