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


Java JavaFileInputBuilder.addExtendsFQN方法代码示例

本文整理汇总了Java中org.opendaylight.controller.config.yangjmxgenerator.plugin.java.JavaFileInputBuilder.addExtendsFQN方法的典型用法代码示例。如果您正苦于以下问题:Java JavaFileInputBuilder.addExtendsFQN方法的具体用法?Java JavaFileInputBuilder.addExtendsFQN怎么用?Java JavaFileInputBuilder.addExtendsFQN使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opendaylight.controller.config.yangjmxgenerator.plugin.java.JavaFileInputBuilder的用法示例。


在下文中一共展示了JavaFileInputBuilder.addExtendsFQN方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toGeneratedObject

import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.JavaFileInputBuilder; //导入方法依赖的package包/类
GeneratedObject toGeneratedObject(FullyQualifiedName concreteFQN,
                                         FullyQualifiedName abstractFQN,
                                         Optional<String> copyright,
                                         Optional<String> header,
                                         Optional<String> classJavaDoc) {
    // there are two constructors and two methods
    JavaFileInputBuilder builder = new JavaFileInputBuilder();
    builder.setTypeName(TypeName.classType);
    builder.setFqn(concreteFQN);
    builder.addExtendsFQN(abstractFQN);

    builder.setCopyright(copyright);
    builder.setHeader(header);
    builder.setClassJavaDoc(classJavaDoc);

    builder.addToBody(getNewCtor(concreteFQN));
    builder.addToBody(getCopyCtor(concreteFQN));
    builder.addToBody(getCustomValidationStub());
    builder.addToBody(getCreateInstanceStub());

    return new GeneratedObjectBuilder(builder.build()).toGeneratedObject();
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:23,代码来源:ConcreteModuleGeneratedObjectFactory.java

示例2: toGeneratedObject

import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.JavaFileInputBuilder; //导入方法依赖的package包/类
public GeneratedObject toGeneratedObject(FtlTemplate template, Optional<String> copyright) {
    JavaFileInputBuilder b = new JavaFileInputBuilder();
    b.setHeader(template.getHeaderString());
    b.setFqn(new FullyQualifiedName(template.getPackageName(), template.getTypeDeclaration().getName()));
    b.setClassJavaDoc(template.getMaybeJavadoc());
    for (Annotation annotation : template.getAnnotations()) {
        b.addClassAnnotation(annotation);
    }
    // type declaration
    for (String extended : template.getTypeDeclaration().getExtended()) {
        b.addExtendsFQN(FullyQualifiedName.fromString(extended));
    }
    for (String implemented : template.getTypeDeclaration().getImplemented()) {
        b.addImplementsFQN(FullyQualifiedName.fromString(implemented));
    }
    b.setCopyright(copyright);
    b.setTypeName(template.getTypeDeclaration().toTypeName());
    // fields
    for (Field field : template.getFields()) {
        b.addToBody(field.toString());
    }
    // constructors
    for (Constructor constructor : template.getConstructors()) {
        b.addToBody(constructor.toString());
    }
    // methods
    for (Method method : template.getMethods()) {
        b.addToBody(method.toString());
    }
    return new GeneratedObjectBuilder(b.build()).toGeneratedObject();
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:32,代码来源:GenericGeneratedObjectFactory.java

示例3: toGeneratedObject

import org.opendaylight.controller.config.yangjmxgenerator.plugin.java.JavaFileInputBuilder; //导入方法依赖的package包/类
public GeneratedObject toGeneratedObject(FullyQualifiedName abstractFQN,
                                         Optional<String> copyright,
                                         Optional<String> header,
                                         Optional<String> classJavaDoc,
                                         Optional<FullyQualifiedName> extended,
                                         List<FullyQualifiedName> implementedInterfaces,
                                         List<ModuleField> moduleFields,
                                         Optional<FullyQualifiedName> maybeRegistratorType,
                                         List<? extends Method> methods,
                                         QName yangModuleQName) {
    JavaFileInputBuilder b = new JavaFileInputBuilder();

    Annotation moduleQNameAnnotation = Annotation.createModuleQNameANnotation(yangModuleQName);
    b.addClassAnnotation(moduleQNameAnnotation);

    b.setFqn(abstractFQN);
    b.setTypeName(TypeName.absClassType);

    b.setCopyright(copyright);
    b.setHeader(header);
    b.setClassJavaDoc(classJavaDoc);
    for(FullyQualifiedName implemented: implementedInterfaces) {
        b.addImplementsFQN(implemented);
    }
    if(extended.isPresent()) {
        b.addExtendsFQN(extended.get());
    }
    if (classJavaDoc.isPresent()) {
        b.addClassAnnotation(format("@%s(value=\"%s\")", Description.class.getCanonicalName(), classJavaDoc.get()));
    }

    // add logger:
    b.addToBody(getLoggerDefinition(abstractFQN));

    b.addToBody("//attributes start");
    for(ModuleField moduleField: moduleFields) {
        b.addToBody(moduleField.toString() +"\n");
    }

    b.addToBody("//attributes end");


    b.addToBody(getNewConstructor(abstractFQN));
    b.addToBody(getCopyFromOldConstructor(abstractFQN));

    b.addToBody(getRuntimeRegistratorCode(maybeRegistratorType));
    b.addToBody(getValidationMethods(moduleFields));

    b.addToBody(getCachesOfResolvedDependencies(moduleFields));
    b.addToBody(getCachesOfResolvedIdentityRefs(moduleFields));
    b.addToBody(getResolveDependencies(moduleFields));
    b.addToBody(getReuseLogic(moduleFields, abstractFQN));
    b.addToBody(getEqualsAndHashCode(abstractFQN));

    b.addToBody(getMethods(methods));
    b.addToBody(getGetLogger());

    return new GeneratedObjectBuilder(b.build()).toGeneratedObject();
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:60,代码来源:AbsModuleGeneratedObjectFactory.java


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