/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Provides simple implementations for most methods in JavaFileObject.
* This class is designed to be subclassed and used as a basis for
* JavaFileObject implementations. Subclasses can override the
* implementation and specification of any method of this class as
* long as the general contract of JavaFileObject is obeyed.
*
* @author Peter von der Ahé
* @since 1.6
*/
/**
* A URI for this file object.
*/
/**
* The kind of this file object.
*/
/**
* Construct a SimpleJavaFileObject of the given kind and with the
* given URI.
*
* @param uri the URI for this file object
* @param kind the kind of this file object
*/
// null checks
}
return uri;
}
}
/**
* This implementation always throws {@linkplain
* UnsupportedOperationException}. Subclasses can change this
* behavior as long as the contract of {@link FileObject} is
* obeyed.
*/
throw new UnsupportedOperationException();
}
/**
* This implementation always throws {@linkplain
* UnsupportedOperationException}. Subclasses can change this
* behavior as long as the contract of {@link FileObject} is
* obeyed.
*/
throw new UnsupportedOperationException();
}
/**
* Wraps the result of {@linkplain #getCharContent} in a Reader.
* Subclasses can change this behavior as long as the contract of
* {@link FileObject} is obeyed.
*
* @param ignoreEncodingErrors {@inheritDoc}
* @return a Reader wrapping the result of getCharContent
* @throws IllegalStateException {@inheritDoc}
* @throws UnsupportedOperationException {@inheritDoc}
* @throws IOException {@inheritDoc}
*/
if (charContent == null)
throw new UnsupportedOperationException();
if (charContent instanceof CharBuffer) {
}
}
/**
* This implementation always throws {@linkplain
* UnsupportedOperationException}. Subclasses can change this
* behavior as long as the contract of {@link FileObject} is
* obeyed.
*/
throw new UnsupportedOperationException();
}
/**
* Wraps the result of openOutputStream in a Writer. Subclasses
* can change this behavior as long as the contract of {@link
* FileObject} is obeyed.
*
* @return a Writer wrapping the result of openOutputStream
* @throws IllegalStateException {@inheritDoc}
* @throws UnsupportedOperationException {@inheritDoc}
* @throws IOException {@inheritDoc}
*/
return new OutputStreamWriter(openOutputStream());
}
/**
* This implementation returns {@code 0L}. Subclasses can change
* this behavior as long as the contract of {@link FileObject} is
* obeyed.
*
* @return {@code 0L}
*/
public long getLastModified() {
return 0L;
}
/**
* This implementation does nothing. Subclasses can change this
* behavior as long as the contract of {@link FileObject} is
* obeyed.
*
* @return {@code false}
*/
public boolean delete() {
return false;
}
/**
* @return {@code this.kind}
*/
return 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}.
*
* <p>This method calls {@link #getKind} and {@link #toUri} and
* does not access the fields {@link #uri} and {@link #kind}
* directly.
*
* <p>Subclasses can change this behavior as long as the contract
* of {@link JavaFileObject} is obeyed.
*/
}
/**
* This implementation returns {@code null}. Subclasses can
* change this behavior as long as the contract of
* {@link JavaFileObject} is obeyed.
*/
/**
* This implementation returns {@code null}. Subclasses can
* change this behavior as long as the contract of
* {@link JavaFileObject} is obeyed.
*/
}
}