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