本文整理汇总了Java中org.aikodi.chameleon.support.modifier.Constructor类的典型用法代码示例。如果您正苦于以下问题:Java Constructor类的具体用法?Java Constructor怎么用?Java Constructor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Constructor类属于org.aikodi.chameleon.support.modifier包,在下文中一共展示了Constructor类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDefaultConstructorWithoutAccessModifier
import org.aikodi.chameleon.support.modifier.Constructor; //导入依赖的package包/类
/**
* Create a default default constructor without an access modifier.
*/
protected JavaMethod createDefaultConstructorWithoutAccessModifier(boolean rebuildCache) {
// FIXME Because this code is ran when a regular Java type is constructed,
// we cannot ask the
// language for the factory. Management of the constructor should be done
// lazily. When
// the type is actually used, we can assume that a language is attached.
// Otherwise, we
// throw an exception.
JavaMethod cons = new JavaMethod(new SimpleNameMethodHeader(name(), new BasicJavaTypeReference(name())));
cons.addModifier(new Constructor());
Block body = new Block();
cons.setImplementation(new RegularImplementation(body));
body.addStatement(new StatementExpression(new SuperConstructorDelegation()));
cons.setUniParent(this);
setDefaultDefaultConstructor(cons);
return cons;
}
示例2: getFilterModifiers
import org.aikodi.chameleon.support.modifier.Constructor; //导入依赖的package包/类
@Override
public List<Modifier> getFilterModifiers() {
List<Modifier> result = new ArrayList<Modifier>();
result.add(new Private());
result.add(new Protected());
result.add(new Public());
result.add(new Default());
result.add(new Static());
result.add(new Final());
result.add(new Abstract());
result.add(new Constructor());
result.add(new Interface());
result.add(new Native());
return result;
}
示例3: toCodeModifier
import org.aikodi.chameleon.support.modifier.Constructor; //导入依赖的package包/类
protected String toCodeModifier(Modifier element) {
if(element instanceof Public) {
return "public";
} else if(element instanceof Protected) {
return "protected";
} else if(element instanceof Private) {
return "private";
} else if(element instanceof Default) {
return "default";
} else if(element instanceof Abstract) {
return "abstract";
} else if(element instanceof Static) {
return "static";
} else if(element instanceof Final) {
return "final";
} else if(element instanceof StrictFP) {
return "strictfp";
} else if(element instanceof Synchronized) {
return "synchronized";
} else if(element instanceof Constructor) {
return "";
} else if(element instanceof Native) {
return "native";
} else if(element instanceof Interface) {
return "";
} else if(element instanceof AnnotationModifier) {
return "@" + toCode(((AnnotationModifier) element).typeReference());
} else if(element instanceof Volatile) {
return "volatile";
} else if(element instanceof Enum) {
return "enum";
}
else {
throw new IllegalArgumentException("The given element is not know by the Java syntax: "+element.getClass().getName());
}
}
示例4: defaultDefaultConstructor
import org.aikodi.chameleon.support.modifier.Constructor; //导入依赖的package包/类
private NormalMethod defaultDefaultConstructor(TypeReference tref, Type writtenType) {
NormalMethod cons = language().plugin(ObjectOrientedFactory.class).createNormalMethod(new SimpleNameMethodHeader(writtenType.name(), clone(tref)));
cons.addModifier(new Constructor());
cons.addModifier(new Public());
cons.setUniParent(this);
return cons;
}
示例5: cloneSelf
import org.aikodi.chameleon.support.modifier.Constructor; //导入依赖的package包/类
@Override
protected Constructor cloneSelf() {
return new JavaConstructor();
}
示例6: visitInitModifier
import org.aikodi.chameleon.support.modifier.Constructor; //导入依赖的package包/类
@Override
public Modifier visitInitModifier(InitModifierContext ctx) {
return new Constructor();
}