本文整理汇总了Java中com.obidea.semantika.util.StringUtils.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.isEmpty方法的具体用法?Java StringUtils.isEmpty怎么用?Java StringUtils.isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.obidea.semantika.util.StringUtils
的用法示例。
在下文中一共展示了StringUtils.isEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createValue
import com.obidea.semantika.util.StringUtils; //导入方法依赖的package包/类
private Value createValue(IValue value)
{
if (value == null) {
return null;
}
if (value instanceof ILiteral) {
ILiteral literal = (ILiteral) value;
String label = literal.stringValue();
String lang = literal.getLanguage();
if (!StringUtils.isEmpty(lang)) {
return mValueFactory.createLiteral(label, lang);
}
else {
String datatype = literal.getDatatype();
return mValueFactory.createLiteral(label, mValueFactory.createURI(datatype));
}
}
else if (value instanceof IUri) {
IUri uri = (IUri) value;
return mValueFactory.createURI(uri.stringValue());
}
return null;
}
示例2: printOutput
import com.obidea.semantika.util.StringUtils; //导入方法依赖的package包/类
@Override
public void printOutput(PrintStream out, Object output)
{
if (output instanceof Map<?, ?>) {
@SuppressWarnings("unchecked")
Map<String, String> map = (Map<String, String>) output;
for (String key : map.keySet()) {
String prefix = key;
if (StringUtils.isEmpty(prefix)) {
prefix = "(default)"; //
}
out.println(prefix + " = " + map.get(key));
}
}
out.println();
}
示例3: getNameFragments
import com.obidea.semantika.util.StringUtils; //导入方法依赖的package包/类
@Override
public String[] getNameFragments()
{
if (mNameFragments == null) {
List<String> fragments = new ArrayList<String>();
if (!StringUtils.isEmpty(mViewName)) {
fragments.add(mViewName);
fragments.add(getColumnName());
}
else {
if (!StringUtils.isEmpty(mSchemaName)) {
fragments.add(mSchemaName);
}
if (!StringUtils.isEmpty(mTableName)) {
fragments.add(mTableName);
}
fragments.add(getColumnName());
}
mNameFragments = CollectionUtils.toArray(fragments, String.class);
}
return mNameFragments;
}
示例4: getLiteralTerm
import com.obidea.semantika.util.StringUtils; //导入方法依赖的package包/类
protected ITerm getLiteralTerm(String value, String termType, String datatype) throws MappingParserException
{
if (termType.equals(R2RmlVocabulary.IRI.getUri())) {
if (!StringUtils.isEmpty(datatype)) {
throw illegalTermalMappingException("Cannot use rr:datatype together with term type rr:IRI"); //$NON-NLS-1$
}
return getExpressionObjectFactory().getUriReference(getUri(value));
}
else if (termType.equals(R2RmlVocabulary.LITERAL.getUri())) {
return (StringUtils.isEmpty(datatype)) ?
getExpressionObjectFactory().getLiteral(value, DataType.STRING) : // by default
getExpressionObjectFactory().getLiteral(value, datatype);
}
else if (termType.equals(R2RmlVocabulary.BLANK_NODE.getUri())) {
throw unsupportedTermTypeException("rr:BlankNode"); //$NON-NLS-1$
}
throw unknownTermTypeException(termType);
}
示例5: getApplicationName
import com.obidea.semantika.util.StringUtils; //导入方法依赖的package包/类
/**
* Returns the application identifier.
*/
public String getApplicationName()
{
String name = getProperty(Environment.APPLICATION_FACTORY_NAME);
if (StringUtils.isEmpty(name)) {
return "semantika"; //$NON-NLS-1$
}
return name;
}
示例6: buildDialect
import com.obidea.semantika.util.StringUtils; //导入方法依赖的package包/类
public static IDialect buildDialect(String dialectName, Connection conn)
{
if (StringUtils.isEmpty(dialectName)) {
return determineDialect(conn);
}
else {
return buildDialect(dialectName);
}
}
示例7: setViewName
import com.obidea.semantika.util.StringUtils; //导入方法依赖的package包/类
@Override
public void setViewName(String viewName)
{
if (!StringUtils.isEmpty(viewName)) {
mViewName = viewName;
mNameFragments = null; // notify to update name fragments
notifyVariableNameChanged(createName(getNameFragments()));
}
}
示例8: getNameFragments
import com.obidea.semantika.util.StringUtils; //导入方法依赖的package包/类
@Override
public String[] getNameFragments()
{
if (mNameFragments == null) {
List<String> fragments = new ArrayList<String>();
if (!StringUtils.isEmpty(mSchemaName)) {
fragments.add(mSchemaName);
}
fragments.add(getTableName());
mNameFragments = CollectionUtils.toArray(fragments, String.class);
}
return mNameFragments;
}
示例9: setAliasName
import com.obidea.semantika.util.StringUtils; //导入方法依赖的package包/类
@Override
public void setAliasName(String alias)
{
if (!StringUtils.isEmpty(alias)) {
mAliasName = alias;
}
}
示例10: constructDatabaseObjectIdentifier
import com.obidea.semantika.util.StringUtils; //导入方法依赖的package包/类
/**
* Constructs identifier string for a database object, given the namespace and
* the local name. Both are separated by a period.
*
* @param namespace
* the namespace string.
* @param localName
* the local name.
* @return identifier name.
*/
public static String constructDatabaseObjectIdentifier(final String namespace, final String localName)
{
StringBuilder sb = new StringBuilder();
if (!StringUtils.isEmpty(namespace)) {
sb.append(namespace).append(DBO_SEPARATOR);
}
if (!StringUtils.isEmpty(localName)) {
sb.append(localName);
}
return sb.toString();
}
示例11: configure
import com.obidea.semantika.util.StringUtils; //导入方法依赖的package包/类
@Override
public void configure(Properties properties) throws ConfigurationException
{
String driverClass = properties.getProperty(Environment.CONNECTION_DRIVER);
if (StringUtils.isEmpty(driverClass)) {
throw new ConfigurationException("JDBC driver is not specified in the configuration file."); //$NON-NLS-1$
}
try {
Class.forName(driverClass);
}
catch (ClassNotFoundException e) {
throw new ConfigurationException("JDBC driver class not found.", e); //$NON-NLS-1$
}
mUrl = properties.getProperty(Environment.CONNECTION_URL);
if (StringUtils.isEmpty(mUrl)) {
throw new ConfigurationException("JDBC URL is not specified in the configuration file."); //$NON-NLS-1$
}
mUser = properties.getProperty(Environment.CONNECTION_USERNAME);
if (StringUtils.isEmpty(mUser)) {
throw new ConfigurationException("JDBC user is not specified in the configuration file."); //$NON-NLS-1$
}
mPassword = properties.getProperty(Environment.CONNECTION_PASSWORD);
if (StringUtils.isEmpty(mPassword)) {
LOG.warn("An empty password is being used."); //$NON-NLS-1$
}
LOG.debug("Configuring {} mode.", getName()); //$NON-NLS-1$
}
示例12: getUri
import com.obidea.semantika.util.StringUtils; //导入方法依赖的package包/类
protected URI getUri(String abbreviatedUri) throws PrefixNotFoundException
{
String normalizedAbbreviatedUri = normalizedAbbreviatedUri(abbreviatedUri);
int colonPos = normalizedAbbreviatedUri.indexOf(":");
String prefixName = normalizedAbbreviatedUri.substring(0, colonPos);
String localName = normalizedAbbreviatedUri.substring(colonPos + 1);
String namespace = getPrefixMapper().get(prefixName);
if (!StringUtils.isEmpty(namespace)) {
return URI.create(namespace + localName);
}
else {
throw prefixNotFoundException(prefixName);
}
}
示例13: createConnectionProvider
import com.obidea.semantika.util.StringUtils; //导入方法依赖的package包/类
public static IConnectionProvider createConnectionProvider(Properties properties) throws ConfigurationException
{
IConnectionProvider provider;
if (!StringUtils.isEmpty(properties.getProperty(Environment.POOL_MAX_SIZE))) {
provider = new PooledConnectionProvider();
}
else {
provider = new JdbcConnectionProvider();
}
provider.configure(properties);
return provider;
}
示例14: process
import com.obidea.semantika.util.StringUtils; //导入方法依赖的package包/类
private void process(String templateString)
{
Matcher m = columnInCurlyBraces.matcher(templateString);
while (m.find()) {
String arg = m.group(1);
if (!StringUtils.isEmpty(arg)) {
mTemplateString = mTemplateString.replace("{" + arg + "}", "{" + mIndex + "}");
mColumnNames.add(arg);
mIndex++;
}
}
}
示例15: isTyped
import com.obidea.semantika.util.StringUtils; //导入方法依赖的package包/类
@Override
public boolean isTyped()
{
return StringUtils.isEmpty(mDatatype) ? false : true;
}