C# Класс Rhino.Optimizer.ClassCompiler

Generates class files from script sources.
Generates class files from script sources. since 1.5 Release 5
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
ClassCompiler ( CompilerEnvirons compilerEnv ) : System

Construct ClassCompiler that uses the specified compiler environment when generating classes.

Construct ClassCompiler that uses the specified compiler environment when generating classes.

CompileToClassFiles ( string source, string sourceLocation, int lineno, string mainClassName ) : object[]

Compile JavaScript source into one or more Java class files.

Compile JavaScript source into one or more Java class files. The first compiled class will have name mainClassName. If the results of GetTargetExtends() or GetTargetImplements() are not null, then the first compiled class will extend the specified super class and implement specified interfaces.

GetCompilerEnv ( ) : CompilerEnvirons

Get the compiler environment the compiler uses.

Get the compiler environment the compiler uses.

GetMainMethodClass ( ) : string

Get the name of the class for main method implementation.

Get the name of the class for main method implementation.

GetTargetExtends ( ) : Type

Get the class that the generated target will extend.

Get the class that the generated target will extend.

GetTargetImplements ( ) : System.Type[]

Get the interfaces that the generated target will implement.

Get the interfaces that the generated target will implement.

SetMainMethodClass ( string className ) : void

Set the class name to use for main method implementation.

Set the class name to use for main method implementation. The class must have a method matching public static void main(Script sc, String[] args), it will be called when main(String[] args) is called in the generated class. The class name should be fully qulified name and include the package name like in org.foo.Bar.

SetTargetExtends ( Type extendsClass ) : void

Set the class that the generated target will extend.

Set the class that the generated target will extend.

SetTargetImplements ( Type implementsClasses ) : void

Set the interfaces that the generated target will implement.

Set the interfaces that the generated target will implement.

Защищенные методы

Метод Описание
MakeAuxiliaryClassName ( string mainClassName, string auxMarker ) : string

Build class name for a auxiliary class generated by compiler.

Build class name for a auxiliary class generated by compiler. If the compiler needs to generate extra classes beyond the main class, it will call this function to build the auxiliary class name. The default implementation simply appends auxMarker to mainClassName but this can be overridden.

Описание методов

ClassCompiler() публичный Метод

Construct ClassCompiler that uses the specified compiler environment when generating classes.
Construct ClassCompiler that uses the specified compiler environment when generating classes.
public ClassCompiler ( CompilerEnvirons compilerEnv ) : System
compilerEnv Rhino.CompilerEnvirons
Результат System

CompileToClassFiles() публичный Метод

Compile JavaScript source into one or more Java class files.
Compile JavaScript source into one or more Java class files. The first compiled class will have name mainClassName. If the results of GetTargetExtends() or GetTargetImplements() are not null, then the first compiled class will extend the specified super class and implement specified interfaces.
public CompileToClassFiles ( string source, string sourceLocation, int lineno, string mainClassName ) : object[]
source string
sourceLocation string
lineno int
mainClassName string
Результат object[]

GetCompilerEnv() публичный Метод

Get the compiler environment the compiler uses.
Get the compiler environment the compiler uses.
public GetCompilerEnv ( ) : CompilerEnvirons
Результат Rhino.CompilerEnvirons

GetMainMethodClass() публичный Метод

Get the name of the class for main method implementation.
Get the name of the class for main method implementation.
public GetMainMethodClass ( ) : string
Результат string

GetTargetExtends() публичный Метод

Get the class that the generated target will extend.
Get the class that the generated target will extend.
public GetTargetExtends ( ) : Type
Результат System.Type

GetTargetImplements() публичный Метод

Get the interfaces that the generated target will implement.
Get the interfaces that the generated target will implement.
public GetTargetImplements ( ) : System.Type[]
Результат System.Type[]

MakeAuxiliaryClassName() защищенный Метод

Build class name for a auxiliary class generated by compiler.
Build class name for a auxiliary class generated by compiler. If the compiler needs to generate extra classes beyond the main class, it will call this function to build the auxiliary class name. The default implementation simply appends auxMarker to mainClassName but this can be overridden.
protected MakeAuxiliaryClassName ( string mainClassName, string auxMarker ) : string
mainClassName string
auxMarker string
Результат string

SetMainMethodClass() публичный Метод

Set the class name to use for main method implementation.
Set the class name to use for main method implementation. The class must have a method matching public static void main(Script sc, String[] args), it will be called when main(String[] args) is called in the generated class. The class name should be fully qulified name and include the package name like in org.foo.Bar.
public SetMainMethodClass ( string className ) : void
className string
Результат void

SetTargetExtends() публичный Метод

Set the class that the generated target will extend.
Set the class that the generated target will extend.
public SetTargetExtends ( Type extendsClass ) : void
extendsClass System.Type the class it extends
Результат void

SetTargetImplements() публичный Метод

Set the interfaces that the generated target will implement.
Set the interfaces that the generated target will implement.
public SetTargetImplements ( Type implementsClasses ) : void
implementsClasses System.Type /// an array of Class objects, one for each /// interface the target will extend ///
Результат void