@GwtIncompatible(value="java.net.URL") static class SourceFile.AtUrl extends SourceFile
In practice this is used to load code in entries inside of zip files.
SourceFile.AtUrl, SourceFile.Builder, SourceFile.Generated, SourceFile.Generator, SourceFile.OnDisk, SourceFile.Preloaded| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
inputCharset |
private static long |
serialVersionUID |
private java.net.URL |
url |
DUPLICATE_ZIP_CONTENTS| Constructor and Description |
|---|
AtUrl(java.net.URL url,
java.lang.String originalPath,
java.nio.charset.Charset c) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearCachedSource() |
java.nio.charset.Charset |
getCharset()
Get the Charset specifying how we're supposed to read the URL
into UTF-16.
|
java.lang.String |
getCode()
Gets all the code in this source file.
|
com.google.common.io.CharSource |
getCodeCharSource()
Gets a char source for the code at this URL.
|
java.io.Reader |
getCodeReader()
Gets a reader for the code at this URL.
|
void |
setCharset(java.nio.charset.Charset c)
Store the Charset specification as the string version of the name,
rather than the Charset itself.
|
builder, fromCode, fromFile, fromFile, fromFile, fromFile, fromGenerator, fromInputStream, fromInputStream, fromReader, fromZipFile, getCodeNoCache, getColumnOfOffset, getLine, getLineOffset, getLineOfOffset, getName, getNumLines, getOriginalPath, getRegion, hasSourceInMemory, isExtern, setCode, setCode, setIsExtern, setOriginalPath, toStringprivate static final long serialVersionUID
private final java.net.URL url
private java.lang.String inputCharset
AtUrl(java.net.URL url,
java.lang.String originalPath,
java.nio.charset.Charset c)
public java.lang.String getCode()
throws java.io.IOException
SourceFilegetCode in class SourceFilejava.io.IOExceptionpublic com.google.common.io.CharSource getCodeCharSource()
getCodeCharSource in class SourceFilepublic java.io.Reader getCodeReader()
throws java.io.IOException
getCodeReader in class SourceFilejava.io.IOExceptionpublic void clearCachedSource()
clearCachedSource in class SourceFilepublic void setCharset(java.nio.charset.Charset c)
c - charset to use when reading the input.public java.nio.charset.Charset getCharset()