本文整理汇总了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);
}
示例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");
}
示例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");
}
示例4: asJavaClassName
import org.jboss.forge.roaster.model.util.Strings; //导入方法依赖的package包/类
public static String asJavaClassName(String name) {
name = dashToCamelCase(name);
return Strings.capitalize(name);
}