Methods Summary |
---|
public boolean | delete()This implementation does nothing. Subclasses can change this
behavior as long as the contract of {@link FileObject} is
obeyed.
return false;
|
public javax.lang.model.element.Modifier | getAccessLevel()This implementation returns {@code null}. Subclasses can
change this behavior as long as the contract of
{@link JavaFileObject} is obeyed. return null;
|
public java.lang.CharSequence | getCharContent(boolean ignoreEncodingErrors)This implementation always throws {@linkplain
UnsupportedOperationException}. Subclasses can change this
behavior as long as the contract of {@link FileObject} is
obeyed.
throw new UnsupportedOperationException();
|
public javax.tools.JavaFileObject.Kind | getKind()
return kind;
|
public long | getLastModified()This implementation returns {@code 0L}. Subclasses can change
this behavior as long as the contract of {@link FileObject} is
obeyed.
return 0L;
|
public java.lang.String | getName()
return toUri().getPath();
|
public javax.lang.model.element.NestingKind | getNestingKind()This implementation returns {@code null}. Subclasses can
change this behavior as long as the contract of
{@link JavaFileObject} is obeyed. return null;
|
public boolean | isNameCompatible(java.lang.String simpleName, javax.tools.JavaFileObject.Kind kind)This implementation compares the path of its URI to the given
simple name. This method returns true if the given kind is
equal to the kind of this object, and if the path is equal to
{@code simpleName + kind.extension} or if it ends with {@code
"/" + simpleName + kind.extension}.
This method calls {@link #getKind} and {@link #toUri} and
does not access the fields {@link #uri} and {@link #kind}
directly.
Subclasses can change this behavior as long as the contract
of {@link JavaFileObject} is obeyed.
String baseName = simpleName + kind.extension;
return kind.equals(getKind())
&& (baseName.equals(toUri().getPath())
|| toUri().getPath().endsWith("/" + baseName));
|
public java.io.InputStream | openInputStream()This implementation always throws {@linkplain
UnsupportedOperationException}. Subclasses can change this
behavior as long as the contract of {@link FileObject} is
obeyed.
throw new UnsupportedOperationException();
|
public java.io.OutputStream | openOutputStream()This implementation always throws {@linkplain
UnsupportedOperationException}. Subclasses can change this
behavior as long as the contract of {@link FileObject} is
obeyed.
throw new UnsupportedOperationException();
|
public java.io.Reader | openReader(boolean ignoreEncodingErrors)Wraps the result of {@linkplain #getCharContent} in a Reader.
Subclasses can change this behavior as long as the contract of
{@link FileObject} is obeyed.
CharSequence charContent = getCharContent(ignoreEncodingErrors);
if (charContent == null)
throw new UnsupportedOperationException();
if (charContent instanceof CharBuffer) {
CharBuffer buffer = (CharBuffer)charContent;
if (buffer.hasArray())
return new CharArrayReader(buffer.array());
}
return new StringReader(charContent.toString());
|
public java.io.Writer | openWriter()Wraps the result of openOutputStream in a Writer. Subclasses
can change this behavior as long as the contract of {@link
FileObject} is obeyed.
return new OutputStreamWriter(openOutputStream());
|
public java.lang.String | toString()
return uri + " from " + getClass().getSimpleName();
|
public java.net.URI | toUri()
return uri;
|