public class MVM extends VirtualMachine
VirtualMachine implementation.| Constructor and Description |
|---|
MVM(Properties styleprops) |
MVM(String styleprops) |
| Modifier and Type | Method and Description |
|---|---|
VirtualMachine |
clear()
Removes all cached compilationUnits.
|
MVM |
encode()
Writes out the source code to all enclosed
CompilationUnit
instances. |
CompilationUnitEncoder |
getEncoder() |
FieldAccess |
newAccess(Class<?> qualifierClass,
Object object) |
FieldAccess |
newAccess(Expression qual,
String name)
Expression factory method which returns a new field access with
the given qualifier and name. |
FieldAccess |
newAccess(String name)
Expression factory method which returns a new field access with
the given qualifier and name. |
FieldAccess |
newAccess(String qual,
String name)
Expression factory method which returns a new field access with
the given qualifier and name. |
Annotation |
newAnnotation(Class<?> annotationClass) |
Annotation |
newAnnotation(String text)
Creates a new annotation with the given name.
|
AnnotationAttribute |
newAnnotationAttribute(String key,
Expression value,
Expression... additionalValues)
Creates a new annotation attribute with the given name and the given
value.
|
NewAnonymousClass |
newAnon(Type type)
Expression factory method which returns a new anonymous class
instance creation expression for the given type. |
NewAnonymousClass |
newAnon(Type type,
Comparator comparator) |
NewAnonymousClass |
newAnonymousClass(String className,
Comparator comparator,
String... genericTypes) |
NewAnonymousClass |
newAnonymousClass(String className,
String... genericTypes) |
ArrayType |
newArray(int type,
int name)
Type factory method which returns an array of primitive type with
the given constant and dimensions. |
ArrayType |
newArray(String type,
int dims)
Type factory method which returns an array of class type with the
given name and dimensions. |
NewArray |
newArray(Type type)
Expression factory method which returns a new array instance
creation expression for the given type. |
ArrayType |
newArray(Type type,
int dims) |
ArrayAccess |
newArrayAccess(Expression qual,
String name)
Expression factory method which returns a new array access
expression with the given qualifier and name. |
ArrayAccess |
newArrayAccess(String name)
Expression factory method which returns a new array access
expression with the given qualifier and name. |
ArrayAccess |
newArrayAccess(String qual,
String name)
Expression factory method which returns a new array access
expression with the given qualifier and name. |
ArrayInitializer |
newArrayInit(Expression[] expressions)
Expression factory method which returns a new array initializer
with the given arguments. |
ArrayInitializer |
newArrayInit(Object o)
Expression factory method which returns a new array initializer
with the given arguments. |
Assign |
newAssign(int type,
Variable l,
Expression r)
Expression factory method which returns a new assignment of the
given type. |
Assign |
newAssign(Variable l,
Expression r)
Expression factory method which returns a new assignment of the
SIMPLE type. |
Binary |
newBinary(int type,
Expression l,
Expression r)
Expression factory method which returns a new unary function of
the given type. |
Blank |
newBlank()
Expression factory method which returns the blank expression. |
BooleanLiteral |
newBoolean(boolean value)
Literal factory method which returns a new boolean
literal. |
Cast |
newBrackets(Expression expression)
Expression factory method which returns a new expression that
wraps brackets around the expression. |
ByteLiteral |
newByte(byte val)
Literal factory method which returns a new byte literal. |
CalendarClassType |
newCalendarType(String pattern)
Type factory method which returns a calendar type with the given
pattern as representation storage. |
Cast |
newCast(Type type,
Expression val)
Expression factory method which returns a new cast function
having the given type and value. |
CharLiteral |
newChar(char val)
Literal factory method which returns a new char literal. |
NewClass |
newClass(Type type)
Expression factory method which returns a new class instance
creation expression for the given type. |
ClassLiteral |
newClassLiteral(ClassType val)
Literal factory method which returns a new Class literal. |
ClassLiteral |
newClassLiteral(String val)
Literal factory method which returns a new Class literal. |
CompilationUnit |
newCompilationUnit(String path)
Creates a new
CompilationUnit in this Machine and returns
it. |
CompilationUnit |
newCompilationUnit(String sourceDirectory,
String packageName)
Creates a new
CompilationUnit in this Machine sets the
namespace and returns it. |
DoubleLiteral |
newDouble(double val)
Literal factory method which returns a new double
literal. |
False |
newFalse()
Literal factory method which returns the boolean false
literal. |
FloatLiteral |
newFloat(float val)
Literal factory method which returns a new float literal. |
Freeform |
newFree(String code)
Expression factory method which returns a new freeform expression
with the given code. |
IntLiteral |
newInt(int val)
Literal factory method which returns a new int literal. |
Invoke |
newInvoke(Class<?> qualifyingClass,
String name) |
Invoke |
newInvoke(Expression qual,
String name)
Expression factory method which returns a new method invocation
with the given qualifier and name. |
Invoke |
newInvoke(String name)
Expression factory method which returns a new method invocation
with the given qualifier and name. |
Invoke |
newInvoke(String qual,
String name)
Expression factory method which returns a new method invocation
with the given qualifier and name. |
LongLiteral |
newLong(long val)
Literal factory method which returns a new long literal. |
Null |
newNull()
Literal factory method which returns the null literal. |
OctalLiteral |
newOctal(char val)
Literal factory method which returns a new octal char
literal. |
ScientificLiteral |
newScientific(int precision,
int scale,
int exponent)
Literal factory method which returns a new scientific floating
point char literal. |
ShortLiteral |
newShort(short val)
Literal factory method which returns a new short literal. |
ClassType |
newSimpleType(Class<?> type) |
StringLiteral |
newString(String val)
Literal factory method which returns a new String
literal. |
Super |
newSuper() |
Ternary |
newTernary(int type,
Expression one,
Expression two,
Expression three)
Expression factory method which returns a new unary function of
the given type. |
This |
newThis() |
This |
newThis(ClassType typeOfOuterClass) |
True |
newTrue()
Literal factory method which returns the boolean true
literal. |
ClassType |
newType(Class<?> clazz)
Type factory method which returns a class type named with the
given Class. |
PrimitiveType |
newType(int type)
Type factory method which returns a primitive type named by the
given int as allowed by the constants listed in the Type
interface. |
ClassType |
newType(String name)
Type factory method which returns a class type named with the
given String. |
Unary |
newUnary(int type,
Expression val)
Expression factory method which returns a new unary function of
the given type. |
UnicodeLiteral |
newUnicode(char val)
Literal factory method which returns a new unicode char
literal. |
Variable |
newVar(String name)
Expression factory method which returns a new variable with the
given name. |
Variable |
newVar(Type type)
Expression factory method which returns a new variable with the
given name. |
Type |
type_boolean() |
Type |
type_byte() |
Type |
type_char() |
Type |
type_double() |
Type |
type_float() |
Type |
type_int() |
Type |
type_long() |
Type |
type_short() |
Type |
type_void() |
ClassType |
typeBigDecimal() |
ClassType |
typeBoolean() |
ClassType |
typeCalendar() |
ClassType |
typeInteger() |
ClassType |
typeLong() |
ClassType |
typeString() |
getVirtualMachine, setVirtualMachinepublic MVM(Properties styleprops)
public MVM(String styleprops) throws IOException
IOExceptionpublic VirtualMachine clear()
VirtualMachineclear in class VirtualMachinepublic MVM encode()
VirtualMachineCompilationUnit
instances.encode in class VirtualMachinepublic CompilationUnitEncoder getEncoder()
getEncoder in class VirtualMachinepublic FieldAccess newAccess(Class<?> qualifierClass, Object object)
newAccess in class VirtualMachinepublic FieldAccess newAccess(Expression qual, String name)
VirtualMachineExpression factory method which returns a new field access with
the given qualifier and name.newAccess in class VirtualMachinepublic FieldAccess newAccess(String name)
VirtualMachineExpression factory method which returns a new field access with
the given qualifier and name.newAccess in class VirtualMachinepublic FieldAccess newAccess(String qual, String name)
VirtualMachineExpression factory method which returns a new field access with
the given qualifier and name.newAccess in class VirtualMachinepublic Annotation newAnnotation(Class<?> annotationClass)
newAnnotation in class VirtualMachinepublic Annotation newAnnotation(String text)
VirtualMachine@Example.newAnnotation in class VirtualMachinetext - The name of the annotation. Must not start with "@".public AnnotationAttribute newAnnotationAttribute(String key, Expression value, Expression... additionalValues)
VirtualMachinenewAnnotationAttribute in class VirtualMachinepublic NewAnonymousClass newAnon(Type type, Comparator comparator)
newAnon in class VirtualMachinepublic NewAnonymousClass newAnon(Type type)
VirtualMachineExpression factory method which returns a new anonymous class
instance creation expression for the given type.newAnon in class VirtualMachinepublic NewAnonymousClass newAnonymousClass(String className, Comparator comparator, String... genericTypes)
newAnonymousClass in class VirtualMachinepublic NewAnonymousClass newAnonymousClass(String className, String... genericTypes)
newAnonymousClass in class VirtualMachinepublic ArrayType newArray(int type, int name)
VirtualMachineType factory method which returns an array of primitive type with
the given constant and dimensions.newArray in class VirtualMachinepublic ArrayType newArray(String type, int dims)
VirtualMachineType factory method which returns an array of class type with the
given name and dimensions.newArray in class VirtualMachinepublic NewArray newArray(Type type)
VirtualMachineExpression factory method which returns a new array instance
creation expression for the given type.newArray in class VirtualMachinepublic ArrayAccess newArrayAccess(Expression qual, String name)
VirtualMachineExpression factory method which returns a new array access
expression with the given qualifier and name.newArrayAccess in class VirtualMachinepublic ArrayAccess newArrayAccess(String name)
VirtualMachineExpression factory method which returns a new array access
expression with the given qualifier and name.newArrayAccess in class VirtualMachinepublic ArrayAccess newArrayAccess(String qual, String name)
VirtualMachineExpression factory method which returns a new array access
expression with the given qualifier and name.newArrayAccess in class VirtualMachinepublic ArrayInitializer newArrayInit(Expression[] expressions)
VirtualMachineExpression factory method which returns a new array initializer
with the given arguments.newArrayInit in class VirtualMachinepublic ArrayInitializer newArrayInit(Object o)
VirtualMachineExpression factory method which returns a new array initializer
with the given arguments.newArrayInit in class VirtualMachinepublic Assign newAssign(int type, Variable l, Expression r)
VirtualMachineExpression factory method which returns a new assignment of the
given type.newAssign in class VirtualMachinepublic Assign newAssign(Variable l, Expression r)
VirtualMachineExpression factory method which returns a new assignment of the
SIMPLE type. This is a convenience * method.newAssign in class VirtualMachinepublic Binary newBinary(int type, Expression l, Expression r)
VirtualMachineExpression factory method which returns a new unary function of
the given type.newBinary in class VirtualMachinepublic Blank newBlank()
VirtualMachineExpression factory method which returns the blank expression.newBlank in class VirtualMachinepublic BooleanLiteral newBoolean(boolean value)
VirtualMachineLiteral factory method which returns a new boolean
literal.newBoolean in class VirtualMachinepublic Cast newBrackets(Expression expression)
VirtualMachineExpression factory method which returns a new expression that
wraps brackets around the expression.newBrackets in class VirtualMachinepublic ByteLiteral newByte(byte val)
VirtualMachineLiteral factory method which returns a new byte literal.newByte in class VirtualMachinepublic CalendarClassType newCalendarType(String pattern)
VirtualMachineType factory method which returns a calendar type with the given
pattern as representation storage.newCalendarType in class VirtualMachinepublic Cast newCast(Type type, Expression val)
VirtualMachineExpression factory method which returns a new cast function
having the given type and value.newCast in class VirtualMachinepublic CharLiteral newChar(char val)
VirtualMachineLiteral factory method which returns a new char literal.newChar in class VirtualMachinepublic NewClass newClass(Type type)
VirtualMachineExpression factory method which returns a new class instance
creation expression for the given type.newClass in class VirtualMachinepublic ClassLiteral newClassLiteral(ClassType val)
VirtualMachineLiteral factory method which returns a new Class literal.newClassLiteral in class VirtualMachinepublic ClassLiteral newClassLiteral(String val)
VirtualMachineLiteral factory method which returns a new Class literal.newClassLiteral in class VirtualMachinepublic CompilationUnit newCompilationUnit(String path)
VirtualMachineCompilationUnit in this Machine and returns
it.newCompilationUnit in class VirtualMachinepublic CompilationUnit newCompilationUnit(String sourceDirectory, String packageName)
VirtualMachineCompilationUnit in this Machine sets the
namespace and returns it.newCompilationUnit in class VirtualMachinepublic DoubleLiteral newDouble(double val)
VirtualMachineLiteral factory method which returns a new double
literal.newDouble in class VirtualMachinepublic False newFalse()
VirtualMachineLiteral factory method which returns the boolean false
literal.newFalse in class VirtualMachinepublic FloatLiteral newFloat(float val)
VirtualMachineLiteral factory method which returns a new float literal.newFloat in class VirtualMachinepublic Freeform newFree(String code)
VirtualMachineExpression factory method which returns a new freeform expression
with the given code.newFree in class VirtualMachinepublic IntLiteral newInt(int val)
VirtualMachineLiteral factory method which returns a new int literal.newInt in class VirtualMachinepublic Invoke newInvoke(Class<?> qualifyingClass, String name)
newInvoke in class VirtualMachinepublic Invoke newInvoke(Expression qual, String name)
VirtualMachineExpression factory method which returns a new method invocation
with the given qualifier and name.newInvoke in class VirtualMachinepublic Invoke newInvoke(String name)
VirtualMachineExpression factory method which returns a new method invocation
with the given qualifier and name.newInvoke in class VirtualMachinepublic Invoke newInvoke(String qual, String name)
VirtualMachineExpression factory method which returns a new method invocation
with the given qualifier and name.newInvoke in class VirtualMachinepublic LongLiteral newLong(long val)
VirtualMachineLiteral factory method which returns a new long literal.newLong in class VirtualMachinepublic Null newNull()
VirtualMachineLiteral factory method which returns the null literal.newNull in class VirtualMachinepublic OctalLiteral newOctal(char val)
VirtualMachineLiteral factory method which returns a new octal char
literal.newOctal in class VirtualMachinepublic ScientificLiteral newScientific(int precision, int scale, int exponent)
VirtualMachineLiteral factory method which returns a new scientific floating
point char literal.newScientific in class VirtualMachinepublic ShortLiteral newShort(short val)
VirtualMachineLiteral factory method which returns a new short literal.newShort in class VirtualMachinepublic ClassType newSimpleType(Class<?> type)
newSimpleType in class VirtualMachinepublic StringLiteral newString(String val)
VirtualMachineLiteral factory method which returns a new String
literal.newString in class VirtualMachinepublic Ternary newTernary(int type, Expression one, Expression two, Expression three)
VirtualMachineExpression factory method which returns a new unary function of
the given type.newTernary in class VirtualMachinepublic True newTrue()
VirtualMachineLiteral factory method which returns the boolean true
literal.newTrue in class VirtualMachinepublic ClassType newType(Class<?> clazz)
VirtualMachineType factory method which returns a class type named with the
given Class.newType in class VirtualMachinepublic PrimitiveType newType(int type)
VirtualMachineType factory method which returns a primitive type named by the
given int as allowed by the constants listed in the Type
interface.newType in class VirtualMachinetype - A primitive type constant. Must not be array or class.public ClassType newType(String name)
VirtualMachineType factory method which returns a class type named with the
given String.newType in class VirtualMachinepublic Unary newUnary(int type, Expression val)
VirtualMachineExpression factory method which returns a new unary function of
the given type.newUnary in class VirtualMachinepublic UnicodeLiteral newUnicode(char val)
VirtualMachineLiteral factory method which returns a new unicode char
literal.newUnicode in class VirtualMachinepublic Variable newVar(String name)
VirtualMachineExpression factory method which returns a new variable with the
given name.newVar in class VirtualMachinepublic Variable newVar(Type type)
VirtualMachineExpression factory method which returns a new variable with the
given name.newVar in class VirtualMachinepublic Type type_boolean()
type_boolean in class VirtualMachinepublic Type type_byte()
type_byte in class VirtualMachinepublic Type type_char()
type_char in class VirtualMachinepublic Type type_double()
type_double in class VirtualMachinepublic Type type_float()
type_float in class VirtualMachinepublic Type type_int()
type_int in class VirtualMachinepublic Type type_long()
type_long in class VirtualMachinepublic Type type_short()
type_short in class VirtualMachinepublic Type type_void()
type_void in class VirtualMachinepublic ClassType typeBigDecimal()
typeBigDecimal in class VirtualMachinepublic ClassType typeBoolean()
typeBoolean in class VirtualMachinepublic ClassType typeCalendar()
typeCalendar in class VirtualMachinepublic ClassType typeInteger()
typeInteger in class VirtualMachinepublic ClassType typeLong()
typeLong in class VirtualMachinepublic ClassType typeString()
typeString in class VirtualMachinepublic Super newSuper()
newSuper in class VirtualMachinepublic This newThis()
newThis in class VirtualMachinepublic This newThis(ClassType typeOfOuterClass)
newThis in class VirtualMachineCopyright © 2000–2018 jenesis4java. All rights reserved.