本文整理汇总了Java中com.helger.jcodemodel.JMod.NONE属性的典型用法代码示例。如果您正苦于以下问题:Java JMod.NONE属性的具体用法?Java JMod.NONE怎么用?Java JMod.NONE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.helger.jcodemodel.JMod
的用法示例。
在下文中一共展示了JMod.NONE属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toJMod
public static int toJMod(MemberAccess accessLevel) {
switch (accessLevel) {
case PRIVATE:
return JMod.PRIVATE;
case PACKAGE:
return JMod.NONE;
case PROTECTED:
return JMod.PROTECTED;
case PUBLIC:
return JMod.PUBLIC;
default:
throw new IllegalStateException("Unsupported AccessLevel: " + accessLevel);
}
}
示例2: createStage0Model
public Stage0ValueClassModel createStage0Model(JDefinedClass bootModel, Visitor visitorAnnotation) {
GenerationProcess generation = new GenerationProcess();
JAnnotationUse annotation = null;
for (JAnnotationUse anyAnnotation: bootModel.annotations()) {
AbstractJClass annotationClass = anyAnnotation.getAnnotationClass();
if (!annotationClass.isError()) {
String fullName = annotationClass.fullName();
if (fullName != null && fullName.equals(GenerateValueClassForVisitor.class.getName()))
annotation = anyAnnotation;
}
}
if (annotation == null)
throw new IllegalStateException("ValueClassModelFactory can't be run for interface without " + GenerateValueClassForVisitor.class + " annotation");
VisitorDefinition visitorModel = generation.processGenerationResult(VisitorDefinition.createInstance(bootModel, visitorAnnotation));
ValueClassConfiguration configuration = generation.processGenerationResult(ValueClassConfiguration.createInstance(visitorModel, annotation));
int mods = configuration.isValueClassPublic() ? JMod.PUBLIC: JMod.NONE;
JDefinedClass valueClass;
try {
valueClass = factory.defineClass(bootModel._package().name(), mods, configuration.valueClassName());
} catch (JClassAlreadyExistsException ex) {
return new Stage0ValueClassModel("Class " + configuration.valueClassName() + " already exists");
}
JAnnotationUse generatedAnnotation = valueClass.annotate(Generated.class);
generatedAnnotation.param("value", GenerateValueClassForVisitorProcessor.class.getName());
Source.annotateParametersAreNonnullByDefault(valueClass);
return new Stage0ValueClassModel(valueClass);
}