|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
public interface ElementFactory
CtElementを生成するファクトリ。
CtReference,
CtLiteralはここでは生成しない。
| メソッドの詳細 |
|---|
<C> CtArrayAccess<C> newArrayAccess()
CtArrayAccessを新しく生成して返す。
C - 参照する配列の要素型
<C> CtArrayAccess<C> newArrayAccess(CtExpression<C[]> array,
CtExpression<Integer> index)
CtArrayAccessを新しく生成して返す。
C - 参照する配列の要素型array - 参照される配列index - 配列の添え字
CtArrayLength newArrayLength()
CtArrayLengthを新しく生成して返す。
<C> CtArrayLength newArrayLength(CtExpression<C[]> array)
CtArrayLengthを新しく生成して返す。
C - 参照する配列の要素型array - 参照される配列
CtAssert newAssert()
CtAssertを新しく生成して返す。
CtAssert newAssert(CtExpression<Boolean> assertion)
CtAssertを新しく生成して返す。
assertion - 表明式
<L,R extends L> CtAssignment<L,R> newAssignment()
CtAssignmentを新しく生成して返す。
L - 左辺の型R - 右辺の型
<L,R extends L> CtAssignment<L,R> newAssignment(CtAssignable<L> left,
CtExpression<R> right)
CtAssignmentを新しく生成して返す。
L - 左辺の型R - 右辺の型left - 左辺式right - 右辺式
CtBlock newBlock()
CtBlockを新しく生成して返す。
CtBreak newBreak()
CtBreakを新しく生成して返す。
<S> CtCase<S> newCase()
CtCaseを新しく生成して返す。
S - switch文のセレクタが持つ型
<S> CtCase<S> newCase(CtExpression<S> expression)
CtCaseを新しく生成して返す。
S - switch文のセレクタが持つ型expression - case式
<T> CtCast<T> newCast()
CtCastを新しく生成して返す。
T - キャスト先の型
<T> CtCast<T> newCast(CtType<T> type,
CtExpression<?> expression)
CtCastを新しく生成して返す。
T - キャスト先の型type - キャスト先の型expression - キャスト対象の式
<T extends Throwable> CtCatch<T> newCatch()
CtCatchを新しく生成して返す。
T - スローする例外の型
<T extends Throwable> CtCatch<T> newCatch(CtLocalVariable<T> formal)
CtCatchを新しく生成して返す。
T - スローする例外の型formal - キャッチする例外引数
<T> CtConditional<T> newConditional()
CtConditionalを新しく生成して返す。
T - 第二項および第三項の型
CtConditional<?> newConditional(CtExpression<Boolean> condition,
CtExpression<?> thenExpr,
CtExpression<?> elseExpr)
CtConditionalを新しく生成して返す。
condition - 条件式thenExpr - 成立時に評価される式elseExpr - 不成立時に評価される式
<T> CtConstructorInvocation<T> newConstructorInvocation()
CtConstructorInvocationを新しく生成して返す。
T - 呼び出すコンストラクタを宣言するクラス
<T> CtConstructorInvocation<T> newConstructorInvocation(CtConstructor<T> spec)
CtConstructorInvocationを新しく生成して返す。
T - 呼び出すコンストラクタを宣言するクラスspec - 起動するコンストラクタ
CtContinue newContinue()
CtContinueを新しく生成して返す。
CtDo newDo()
CtDoを新しく生成して返す。
CtDo newDo(CtStatement body,
CtExpression<Boolean> condition)
CtDoを新しく生成して返す。
body - ループ本体condition - 条件式
CtEmptyStatement newEmptyStatement()
CtEmptyStatementを新しく生成して返す。
CtForEach newEnhancedFor()
CtForEachを新しく生成して返す。
CtForEach newEnhancedFor(CtLocalVariable<?> variable,
CtExpression<?> iterable,
CtStatement body)
CtForEachを新しく生成して返す。
variable - ループ変数iterable - 繰り返す要素body - ループ本体
CtFor newFor()
CtForを新しく生成して返す。
CtFor newFor(CtStatement init,
CtExpression<Boolean> condition,
CtStatement update,
CtStatement body)
CtForを新しく生成して返す。
init - 初期化文condition - 条件文update - 更新文body - ループ本体
CtThrow newThrow()
CtThrowを新しく生成して返す。
CtThrow newThrow(CtExpression<? extends Throwable> thrown)
CtThrowを新しく生成して返す。
thrown - スローされるべき例外の式
CtIf newIf()
CtIfを新しく生成して返す。
CtIf newIf(CtExpression<Boolean> condition,
CtStatement thenStmt)
CtIfを新しく生成して返す。
condition - 条件式thenStmt - 成立時に実行される文
CtIf newIf(CtExpression<Boolean> condition,
CtStatement thenStmt,
CtStatement elseStmt)
CtIfを新しく生成して返す。
condition - 条件式thenStmt - 成立時に実行される文elseStmt - 不成立時に実行される文
<T> CtInfix<T> newInfix()
CtInfixを新しく生成して返す。
T - この式を評価した際の型
CtInfix<?> newInfix(CtExpression<?> left,
InfixOperator op,
CtExpression<?> right)
+, -, *, /, %, &, |, ^, &&, ||を表すCtInfixを新しく生成して返す。
left - 第一演算数op - 演算子right - 第二演算数
CtInstanceof newInstanceof()
CtInstanceofを新しく生成して返す。
CtInstanceof newInstanceof(CtExpression<?> object,
CtType<?> type)
CtInstanceofを新しく生成して返す。
object - 比較されるオブジェクトtype - 比較先の型
<T> CtMethodInvocation<T> newMethodInvocation()
CtMethodInvocationを新しく生成して返す。
T - この式を評価した際の型
<T> CtMethodInvocation<T> newMethodInvocation(CtMethod<T> spec)
CtMethodInvocationを新しく生成して返す。
T - この式を評価した際の型spec - 起動されるメソッド
<C> CtNewArray<C> newNewArray()
CtNewArrayを新しく生成して返す。
C - 生成する配列の要素型
<C> CtNewArray<C> newNewArray(CtArray<C> spec)
CtNewArrayを新しく生成して返す。
C - 生成する配列の要素型spec - 生成される配列の型
<C> CtNewArray<C> newNewArrayWithDimensions(CtArray<C> spec,
List<? extends CtExpression<Integer>> dimensions)
CtNewArrayを新しく生成して返す。
C - 生成する配列の要素型spec - 生成される配列の型dimensions - 各次元の要素数
<C> CtNewArray<C> newNewArrayWithInitialElements(CtArray<C> spec,
List<? extends CtExpression<? extends C>> initializer)
CtNewArrayを新しく生成して返す。
C - 生成する配列の要素型spec - 生成される配列の型initializer - 各要素の初期値リスト
<T> CtNewInstance<T> newNewInstance()
CtNewInstanceを新しく生成して返す。
T - 生成するインスタンスの型
<T> CtNewInstance<T> newNewInstance(CtConstructor<T> spec)
CtNewInstanceを新しく生成して返す。
T - 生成するインスタンスの型spec - インスタンス生成時に起動されるコンストラクタ
<T> CtReturn<T> newReturn()
CtReturnを新しく生成して返す。
T - 戻り値の型
<T> CtReturn<T> newReturn(CtExpression<T> result)
CtReturnを新しく生成して返す。
T - 戻り値の型result - 結果を表す式
CtTry newTry()
CtTryを新しく生成して返す。
<S> CtSwitch<S> newSwitch()
CtSwitchを新しく生成して返す。
S - セレクタ式の型
<S> CtSwitch<S> newSwitch(CtExpression<S> selector)
CtSwitchを新しく生成して返す。
S - セレクタ式の型selector - セレクタ式
CtSynchronized newSynchronized()
CtSynchronizedを新しく生成して返す。
CtSynchronized newSynchronized(CtExpression<?> lock)
CtSynchronizedを新しく生成して返す。
lock - ロックオブジェクト
<T> CtUnary<T> newUnary()
CtUnaryを新しく生成して返す。
T - この式を評価した際の型
CtUnary<?> newPrefix(UnaryOperator operator,
CtExpression<?> operand)
CtUnaryを新しく生成して返す。
operator - 前置演算子operand - 演算数
CtUnary<?> newPostfix(CtExpression<?> operand,
UnaryOperator operator)
CtUnaryを新しく生成して返す。
operator - 後置演算子operand - 演算数
<T> CtVariableAccess<T> newVariableAccess()
CtVariableAccessを新しく生成して返す。
T - この式を評価した際の型
<T> CtVariableAccess<T> newVariableAccess(CtVariable<T> variable)
CtVariableAccessを新しく生成して返す。
T - この式を評価した際の型variable - 参照する変数
<T> CtVariableAccess<T> newVariableAccess(CtExpression<?> object,
CtField<T> field)
CtVariableAccessを新しく生成して返す。
T - この式を評価した際の型object - フィールドを保持する式field - 参照するフィールド
CtWhile newWhile()
CtWhileを新しく生成して返す。
CtWhile newWhile(CtExpression<Boolean> condition,
CtStatement body)
CtWhileを新しく生成して返す。
condition - 条件式body - ループ本体
<A extends Annotation> CtAnnotationInstance<A> newAnnotationInstance()
CtAnnotationInstanceを新しく生成して返す。
A - 注釈の型
<A extends Annotation> CtAnnotationInstance<A> newAnnotationInstance(CtAnnotation<A> spec)
CtAnnotationInstanceを新しく生成して返す。
A - 注釈の型spec - 注釈の宣言
<T> CtAnnotationInstanceElement<T> newAnnotationInstanceElement()
CtAnnotationInstanceElementを新しく生成して返す。
T - 要素の型
<T> CtAnnotationInstanceElement<T> newAnnotationInstanceElement(CtAnnotationElement<T> spec,
CtExpression<T> constant)
CtAnnotationInstanceElementを新しく生成して返す。
T - 要素の型spec - 注釈要素constant - 注釈要素の値
CtModifier newModifier()
CtModifier newModifier(ModifierKind kind)
kind - 修飾子の種類
CtLabel newLabel(String name)
CtLabelを新しく生成して返す。
name - ラベルの名称
<T> CtParameter<T> newParameter(CtType<T> type,
String name)
CtParameterを新しく生成して返す。
T - 変数の型type - 引数の型name - 引数の名称
<T> CtLocalVariable<T> newLocalVariable(CtType<T> type,
String name)
CtLocalVariableを新しく生成して返す。
T - 変数の型type - 変数の型name - 変数の名称
CtTypeParameter<?> newTypeParameter(String name)
CtTypeParameterを新しく生成して返す。
name - 型引数の名称
<B> CtTypeParameter<? extends B> newTypeParameter(String name,
CtType<B> primaryBound)
CtTypeParameterを新しく生成して返す。
B - 境界の型name - 型引数の名称primaryBound - 境界宣言
CtTypeParameter<?> newTypeParameter(String name,
List<? extends CtType<?>> bounds)
CtTypeParameterを新しく生成して返す。
name - 型引数の名称bounds - 型境界リスト
ElementFactory borrow()
Tool の記述:
Tool 内の borrow
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||