本文整理汇总了Java中org.springframework.util.StringUtils.trimArrayElements方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.trimArrayElements方法的具体用法?Java StringUtils.trimArrayElements怎么用?Java StringUtils.trimArrayElements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.util.StringUtils
的用法示例。
在下文中一共展示了StringUtils.trimArrayElements方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseAliase
import org.springframework.util.StringUtils; //导入方法依赖的package包/类
public String[] parseAliase(Element element) {
if (element == null) {
return null;
}
String[] aliases = null;
String name = element.getAttribute(NAME_ATTRIBUTE);
if (StringUtils.hasLength(name)) {
aliases = StringUtils.trimArrayElements(
StringUtils.commaDelimitedListToStringArray(name));
}
return aliases;
}
示例2: setAsText
import org.springframework.util.StringUtils; //导入方法依赖的package包/类
@Override
public void setAsText(String text) throws IllegalArgumentException {
String[] array = StringUtils.delimitedListToStringArray(text, this.separator, this.charsToDelete);
if (trimValues) {
array = StringUtils.trimArrayElements(array);
}
if (this.emptyArrayAsNull && array.length == 0) {
setValue(null);
}
else {
setValue(array);
}
}
示例3: parse
import org.springframework.util.StringUtils; //导入方法依赖的package包/类
@Override
public final BeanDefinition parse(Element element, ParserContext parserContext) {
AbstractBeanDefinition definition = parseInternal(element, parserContext);
if (definition != null && !parserContext.isNested()) {
try {
String id = resolveId(element, definition, parserContext);
if (!StringUtils.hasText(id)) {
parserContext.getReaderContext().error(
"Id is required for element '" + parserContext.getDelegate().getLocalName(element)
+ "' when used as a top-level tag", element);
}
String[] aliases = new String[0];
String name = element.getAttribute(NAME_ATTRIBUTE);
if (StringUtils.hasLength(name)) {
aliases = StringUtils.trimArrayElements(StringUtils.commaDelimitedListToStringArray(name));
}
BeanDefinitionHolder holder = new BeanDefinitionHolder(definition, id, aliases);
registerBeanDefinition(holder, parserContext.getRegistry());
if (shouldFireEvents()) {
BeanComponentDefinition componentDefinition = new BeanComponentDefinition(holder);
postProcessComponentDefinition(componentDefinition);
parserContext.registerComponent(componentDefinition);
}
}
catch (BeanDefinitionStoreException ex) {
parserContext.getReaderContext().error(ex.getMessage(), element);
return null;
}
}
return definition;
}