当前位置: 首页>>代码示例>>Java>>正文


Java Constructor类代码示例

本文整理汇总了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;
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:21,代码来源:RegularJavaType.java

示例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;
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:16,代码来源:JavaEditorExtension.java

示例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());
  }
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:37,代码来源:Java7Syntax.java

示例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;
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:8,代码来源:AnonymousType.java

示例5: cloneSelf

import org.aikodi.chameleon.support.modifier.Constructor; //导入依赖的package包/类
@Override
protected Constructor cloneSelf() {
	return new JavaConstructor();
}
 
开发者ID:markovandooren,项目名称:jnome,代码行数:5,代码来源:JavaConstructor.java

示例6: visitInitModifier

import org.aikodi.chameleon.support.modifier.Constructor; //导入依赖的package包/类
@Override
public Modifier visitInitModifier(InitModifierContext ctx) {
  return new Constructor();
}
 
开发者ID:markovandooren,项目名称:jlo,代码行数:5,代码来源:JLoConvertor.java


注:本文中的org.aikodi.chameleon.support.modifier.Constructor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。