com.sun.codemodel.fmt
Class JStaticJavaFile

java.lang.Object  extended by com.sun.codemodel.JResourceFile      extended by com.sun.codemodel.fmt.JStaticJavaFile

public final class JStaticJavaFile
extends JResourceFile

Statically generated Java soruce file.

This JResourceFile implementation will generate a Java source file by copying the source code from a resource.

While copying a resource, we look for a package declaration and replace it with the target package name. This allows the static Java source code to have an arbitrary package declaration.

You can also use the getJClass method to obtain a JClass object that represents the static file. This allows the client code to refer to the class from other CodeModel generated code.

Note that because we don't parse the static Java source code, the returned JClass object doesn't respond to methods like "isInterface" or "_extends",

Author:
Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)


Nested Class Summary
static classJStaticJavaFile.ChainFilter
          A JStaticJavaFile.LineFilter that combines two JStaticJavaFile.LineFilters.
static interfaceJStaticJavaFile.LineFilter
          Filter that alters the Java source code.
 
Constructor Summary
JStaticJavaFile(JPackage _pkg, String className, String _resourceName)
           
JStaticJavaFile(JPackage _pkg, String _className, URL _source, JStaticJavaFile.LineFilter _filter)
           
 
Method Summary
protected  voidbuild(OutputStream os)
          called by JPackage to produce the file image.
 JClassgetJClass()
          Returns a class object that represents a statically generated code.
protected  booleanisResource()
          Returns true if this file should be generated into the directory that the resource files go into.
 
Methods inherited from class com.sun.codemodel.JResourceFile
name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JStaticJavaFile

public JStaticJavaFile(JPackage _pkg,                       String className,                       String _resourceName)

JStaticJavaFile

public JStaticJavaFile(JPackage _pkg,                       String _className,                       URL _source,                       JStaticJavaFile.LineFilter _filter)
Method Detail

getJClass

public final JClass getJClass()
Returns a class object that represents a statically generated code.


isResource

protected boolean isResource()
Description copied from class: JResourceFile
Returns true if this file should be generated into the directory that the resource files go into.

Returns false if this file should be generated into the directory where other source files go.

Overrides:
isResource in class JResourceFile

build

protected void build(OutputStream os)              throws IOException
Description copied from class: JResourceFile
called by JPackage to produce the file image.

Specified by:
build in class JResourceFile
Throws:
IOException


Copyright © 2005-2011
Oracle. All Rights Reserved.


NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14