本文整理匯總了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;
}