本文整理了Java中org.jenkinsci.Symbol.value()
方法的一些代码示例,展示了Symbol.value()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Symbol.value()
方法的具体详情如下:
包路径:org.jenkinsci.Symbol
类名称:Symbol
方法名:value
暂无
代码示例来源:origin: jenkinsci/configuration-as-code-plugin
private String resolveName(Descriptor descriptor) {
return Optional.ofNullable(descriptor.getClass().getAnnotation(Symbol.class))
.map(s -> s.value()[0])
.orElseGet(() -> {
/* TODO: extract Descriptor parameter type such that DescriptorImpl extends Descriptor<XX> returns XX.
* Then, if `baseClass == fooXX` we get natural name `foo`.
*/
return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, descriptor.getKlass().toJavaClass().getSimpleName());
});
}
}
代码示例来源:origin: jenkinsci/configuration-as-code-plugin
@Override
public String getName() {
final Class c = category.getClass();
final Symbol symbol = (Symbol) c.getAnnotation(Symbol.class);
if (symbol != null) return symbol.value()[0];
String name = c.getSimpleName();
name = StringUtils.remove(name, "Global");
name = StringUtils.remove(name, "Configuration");
name = StringUtils.remove(name, "Category");
return name.toLowerCase();
}
代码示例来源:origin: jenkinsci/configuration-as-code-plugin
/**
* Get a configurator name.
* @return short name for this component when used in a configuration.yaml file
*/
@Nonnull
default String getName() {
final Symbol annotation = getTarget().getAnnotation(Symbol.class);
if (annotation != null) return annotation.value()[0];
return normalize(getTarget().getSimpleName());
}
代码示例来源:origin: jenkinsci/configuration-as-code-plugin
symbols.addAll(Arrays.asList(s.value()));
代码示例来源:origin: jenkinsci/warnings-ng-plugin
/**
* Returns the {@link Symbol} name of this tool.
*
* @return the name of this tool, or "undefined" if no symbol has been defined
*/
public String getSymbolName() {
Symbol annotation = getClass().getAnnotation(Symbol.class);
if (annotation != null) {
String[] symbols = annotation.value();
if (symbols.length > 0) {
return symbols[0];
}
}
return "unknownSymbol";
}
代码示例来源:origin: io.jenkins/configuration-as-code
private String resolveName(Descriptor descriptor) {
return Optional.ofNullable(descriptor.getClass().getAnnotation(Symbol.class))
.map(s -> s.value()[0])
.orElseGet(() -> {
/* TODO: extract Descriptor parameter type such that DescriptorImpl extends Descriptor<XX> returns XX.
* Then, if `baseClass == fooXX` we get natural name `foo`.
*/
return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, descriptor.getKlass().toJavaClass().getSimpleName());
});
}
}
代码示例来源:origin: io.jenkins/configuration-as-code
@Override
public String getName() {
final Class c = category.getClass();
final Symbol symbol = (Symbol) c.getAnnotation(Symbol.class);
if (symbol != null) return symbol.value()[0];
String name = c.getSimpleName();
name = StringUtils.remove(name, "Global");
name = StringUtils.remove(name, "Configuration");
name = StringUtils.remove(name, "Category");
return name.toLowerCase();
}
代码示例来源:origin: io.jenkins/configuration-as-code
/**
* Get a configurator name.
* @return short name for this component when used in a configuration.yaml file
*/
@Nonnull
default String getName() {
final Symbol annotation = getTarget().getAnnotation(Symbol.class);
if (annotation != null) return annotation.value()[0];
return normalize(getTarget().getSimpleName());
}
代码示例来源:origin: jenkinsci/pipeline-model-definition-plugin
private static String symbolFromDescriptor(Descriptor d) {
Symbol s = d.getClass().getAnnotation(Symbol.class);
if (s != null) {
return s.value()[0];
}
return null;
}
代码示例来源:origin: io.jenkins/configuration-as-code
symbols.addAll(Arrays.asList(s.value()));
内容来源于网络,如有侵权,请联系作者删除!