Top Description Fields Constructors Methods
org.codehaus.commons.compiler.util.resource

public Class StringResource

extends Object
implements Resource
Class Inheritance
All Implemented Interfaces
org.codehaus.commons.compiler.util.resource.Resource
Imports
java.io.ByteArrayInputStream, .InputStream

A resource who's content is a String.

Field Summary

Modifier and TypeField and Description
private final byte[]
private final String

Constructor Summary

AccessConstructor and Description
public
StringResource(String fileName, String text)

Method Summary

Modifier and TypeMethod and Description
public final String
getFileName()

Implements org.codehaus.commons.compiler.util.resource.Resource.getFileName.

Returns a decorative "file name" that can be used for reporting errors and the like.
public final long
lastModified()

Implements org.codehaus.commons.compiler.util.resource.Resource.lastModified.

Returns the time of the last modification, in milliseconds since 1970, or 0L if the time of the last modification cannot be determined.
public final InputStream
public final String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

databack to summary
private final byte[] data
fileNameback to summary
private final String fileName

Constructor Detail

StringResourceback to summary
public StringResource(String fileName, String text)

Method Detail

getFileNameback to summary
public final String getFileName()

Implements org.codehaus.commons.compiler.util.resource.Resource.getFileName.

Doc from org.codehaus.commons.compiler.util.resource.Resource.getFileName.

Returns 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!

Annotations
@Override
lastModifiedback to summary
public final long lastModified()

Implements org.codehaus.commons.compiler.util.resource.Resource.lastModified.

Doc from org.codehaus.commons.compiler.util.resource.Resource.lastModified.

Returns the time of the last modification, in milliseconds since 1970, or 0L if the time of the last modification cannot be determined.

Annotations
@Override
openback to summary
public final InputStream open()

Implements org.codehaus.commons.compiler.util.resource.Resource.open.

Doc from org.codehaus.commons.compiler.util.resource.Resource.open.

Opens the resource. The caller is responsible for closing the java.io.InputStream.

Annotations
@Override
toStringback to summary
public final String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override