本文整理匯總了Java中ca.nrc.cadc.util.StringUtil.hasText方法的典型用法代碼示例。如果您正苦於以下問題:Java StringUtil.hasText方法的具體用法?Java StringUtil.hasText怎麽用?Java StringUtil.hasText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ca.nrc.cadc.util.StringUtil
的用法示例。
在下文中一共展示了StringUtil.hasText方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getGroupName
import ca.nrc.cadc.util.StringUtil; //導入方法依賴的package包/類
public final String getGroupName() {
// canonical form: ivo://<authority>/<path>?<name>
String ret = groupID.getQuery();
if (StringUtil.hasText(ret)) {
return ret;
}
// backwards compat
ret = groupID.getFragment();
if (StringUtil.hasText(ret)) {
return ret;
}
// temporary backwards compat for caom2ac usage hack
return groupID.toASCIIString();
}
示例2: validateProposalGroup
import ca.nrc.cadc.util.StringUtil; //導入方法依賴的package包/類
private static void validateProposalGroup(boolean proposalGroup, String staffGroup) {
if (proposalGroup) {
if (!StringUtil.hasText(staffGroup)) {
throw new IllegalArgumentException("staff group is not specified for proposal group");
}
}
}
示例3: decodeStates
import ca.nrc.cadc.util.StringUtil; //導入方法依賴的package包/類
public static void decodeStates(String val, List<PolarizationState> out) {
if (val == null) {
return;
}
String[] ss = val.split(POL_STATE_SEPARATOR);
for (String s : ss) {
if (StringUtil.hasText(s)) {
PolarizationState ps = PolarizationState.toValue(s);
out.add(ps);
}
}
}
示例4: ObservationWriter
import ca.nrc.cadc.util.StringUtil; //導入方法依賴的package包/類
/**
* Constructor. This uses the specified CAOM namespace prefix (null is not
* allowed). If writeEmptyCollections is true, empty elements will be
* included for any collections that are empty; this is not necessary but is
* valid in the schema so is useful for testing.
*
* @param caom2NamespacePrefix
* @param namespace
* a valid CAOM-2.x target namespace
* @param writeEmptyCollections
*/
public ObservationWriter(String caom2NamespacePrefix, String namespace,
boolean writeEmptyCollections) {
this.writeEmptyCollections = writeEmptyCollections;
if (!StringUtil.hasText(caom2NamespacePrefix)) {
throw new IllegalArgumentException(
"null or 0-length namespace prefix is not allowed: "
+ caom2NamespacePrefix);
}
if (namespace == null) {
namespace = XmlConstants.CAOM2_3_NAMESPACE; // default
log.debug("default namespace: " + namespace);
}
if (XmlConstants.CAOM2_3_NAMESPACE.equals(namespace)) {
this.caom2Namespace = Namespace.getNamespace(caom2NamespacePrefix,
XmlConstants.CAOM2_3_NAMESPACE);
docVersion = 23;
} else if (XmlConstants.CAOM2_2_NAMESPACE.equals(namespace)) {
this.caom2Namespace = Namespace.getNamespace(caom2NamespacePrefix,
XmlConstants.CAOM2_2_NAMESPACE);
docVersion = 22;
} else if (XmlConstants.CAOM2_1_NAMESPACE.equals(namespace)) {
this.caom2Namespace = Namespace.getNamespace(caom2NamespacePrefix,
XmlConstants.CAOM2_1_NAMESPACE);
docVersion = 21;
} else if (XmlConstants.CAOM2_0_NAMESPACE.equals(namespace)) {
this.caom2Namespace = Namespace.getNamespace(caom2NamespacePrefix,
XmlConstants.CAOM2_0_NAMESPACE);
docVersion = 20;
} else {
throw new IllegalArgumentException(
"invalid namespace: " + namespace);
}
this.xsiNamespace = Namespace.getNamespace("xsi",
XmlConstants.XMLSCHEMA);
log.debug("output version: " + docVersion + " "
+ caom2Namespace.getPrefix() + " -> "
+ caom2Namespace.getURI());
}