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


Java Strings.capitalize方法代码示例

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


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

示例1: createJavaComponentFactoryClass

import org.jboss.forge.roaster.model.util.Strings; //导入方法依赖的package包/类
public static void createJavaComponentFactoryClass(JavaClassSource javaClass, CamelComponentDetails details, String camelComponentName,
                                                   String componentInstanceName, String configurationCode, Set<String> extraJavaImports) {
    javaClass.addImport(details.getComponentClassQName());
    if (extraJavaImports != null) {
        for (String extra : extraJavaImports) {
            javaClass.addImport(extra);
        }
    }

    String componentClassName = details.getComponentClassName();
    String methodName = "create" + Strings.capitalize(componentInstanceName) + "Component";

    String body = componentClassName + " component = new " + componentClassName + "();" + configurationCode + "\nreturn component;";

    javaClass.addMethod()
            .setPublic()
            .setReturnType(componentClassName)
            .setName(methodName)
            .setBody(body);
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:21,代码来源:CamelCommandsHelper.java

示例2: createCdiComponentProducerClass

import org.jboss.forge.roaster.model.util.Strings; //导入方法依赖的package包/类
public static void createCdiComponentProducerClass(JavaClassSource javaClass, CamelComponentDetails details, String camelComponentName,
                                                   String componentInstanceName, String configurationCode, Set<String> extraJavaImports) {
    javaClass.addImport("javax.enterprise.inject.Produces");
    javaClass.addImport("javax.inject.Singleton");
    javaClass.addImport("javax.inject.Named");
    javaClass.addImport(details.getComponentClassQName());
    if (extraJavaImports != null) {
        for (String extra : extraJavaImports) {
            javaClass.addImport(extra);
        }
    }

    String componentClassName = details.getComponentClassName();
    String methodName = "create" + Strings.capitalize(componentInstanceName) + "Component";

    String body = componentClassName + " component = new " + componentClassName + "();" + configurationCode + "\nreturn component;";

    MethodSource<JavaClassSource> method = javaClass.addMethod()
            .setPublic()
            .setReturnType(componentClassName)
            .setName(methodName)
            .setBody(body);

    method.addAnnotation("Named").setStringValue(camelComponentName);
    method.addAnnotation("Produces");
    method.addAnnotation("Singleton");
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:28,代码来源:CamelCommandsHelper.java

示例3: createSpringComponentFactoryClass

import org.jboss.forge.roaster.model.util.Strings; //导入方法依赖的package包/类
public static void createSpringComponentFactoryClass(JavaClassSource javaClass, CamelComponentDetails details, String camelComponentName,
                                                     String componentInstanceName, String configurationCode, Set<String> extraJavaImports) {
    javaClass.addAnnotation("Component");

    javaClass.addImport("org.springframework.beans.factory.config.BeanDefinition");
    javaClass.addImport("org.springframework.beans.factory.annotation.Qualifier");
    javaClass.addImport("org.springframework.context.annotation.Bean");
    javaClass.addImport("org.springframework.context.annotation.Scope");
    javaClass.addImport("org.springframework.stereotype.Component");
    javaClass.addImport(details.getComponentClassQName());
    if (extraJavaImports != null) {
        for (String extra : extraJavaImports) {
            javaClass.addImport(extra);
        }
    }

    String componentClassName = details.getComponentClassName();
    String methodName = "create" + Strings.capitalize(componentInstanceName) + "Component";

    String body = componentClassName + " component = new " + componentClassName + "();" + configurationCode + "\nreturn component;";

    MethodSource<JavaClassSource> method = javaClass.addMethod()
            .setPublic()
            .setReturnType(componentClassName)
            .setName(methodName)
            .setBody(body);

    method.addAnnotation("Qualifier").setStringValue(camelComponentName);
    method.addAnnotation("Bean");
    method.addAnnotation("Scope").setLiteralValue("BeanDefinition.SCOPE_SINGLETON");
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:32,代码来源:CamelCommandsHelper.java

示例4: asJavaClassName

import org.jboss.forge.roaster.model.util.Strings; //导入方法依赖的package包/类
public static String asJavaClassName(String name) {
    name = dashToCamelCase(name);
    return Strings.capitalize(name);
}
 
开发者ID:fabric8io,项目名称:django,代码行数:5,代码来源:CamelCommandsHelper.java


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