当前页面:
在线文档首页 >
NetBeans API Javadoc 4.1.0
JMIStreamFactory (NetBeans MDR API) - NetBeans API Javadoc 4.1.0
org.netbeans.api.mdr
Class JMIStreamFactory
java.lang.Object
org.netbeans.api.mdr.JMIStreamFactory
- public abstract class JMIStreamFactory
- extends Object
Class used by JMI mapper to obtain output streams for generating JMI interfaces.
Subclasses should implement the createStream(List, String, String)
method to create/open an output stream based on a provided package name, class
name and file extension.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EXT_JAVA
public static final String EXT_JAVA
- Extension for Java source files
- See Also:
- Constant Field Values
EXT_CLASS
public static final String EXT_CLASS
- Extension for Java bytecode files
- See Also:
- Constant Field Values
JMIStreamFactory
public JMIStreamFactory()
createStream
public OutputStream createStream(List pkg,
String className)
throws IOException
- Creates a new output stream based on a provided package name and class name.
Assumes that the data generated will be Java source code (e.g. creates FileOutputStream
for a file with "java" extension). Calling this method has the same effect
as calling
createStream(List, String, String)
with the last parameter
set to EXT_JAVA
.
- Parameters:
pkg
- Parsed package name.className
- Class name.
- Returns:
- Created stream, or
null
if nothing needs to be written
for the class or interface.
- Throws:
IOException
- I/O error during stream creation.
createStream
public abstract OutputStream createStream(List pkg,
String className,
String extension)
throws IOException
- Creates a new output stream based on a provided package name, class name and
extension for the returned stream should correspond to (e.g.
EXT_CLASS
to generate byte code or EXT_JAVA
to generate
source code). The stream factory can return null
to indicate
that nothing needs to be written for the given class or interface. For
example, if the stream factory is able to determine that the destination
file already exists and is up to date, then null
could be
returned so that the file is not needlessly rewritten.
- Parameters:
pkg
- Parsed package name.className
- Class name.extension
- The type of file that should be generated.
- Returns:
- Created stream, or
null
if nothing needs to be written
for the class or interface.
- Throws:
IOException
- I/O error during stream creation.