de.tsl2.nano.core.util.Util.isEmpty()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(450)

本文整理了Java中de.tsl2.nano.core.util.Util.isEmpty()方法的一些代码示例,展示了Util.isEmpty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.isEmpty()方法的具体详情如下:
包路径:de.tsl2.nano.core.util.Util
类名称:Util
方法名:isEmpty

Util.isEmpty介绍

暂无

代码示例

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.directaccess

/**
 * @return Returns the defaultSchema.
 */
public String getDefaultSchema() {
  if (Util.isEmpty(defaultSchema) && !Util.isEmpty(connectionUserName)) {
    defaultSchema = connectionUserName.toUpperCase();
  }
  return defaultSchema;
}

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.cursus

protected void checkAndSave(Set<ERes> parts) {
  if (Util.isEmpty(parts))
    throw new IllegalArgumentException("no objectIDs defined -> nothing to do!");
  checkAndSave();
}

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.terminal

private void clearScreeen() {
  try {
    if (!Util.isEmpty(clearScreenCmd))
      SystemUtil.execute(clearScreenCmd);
  } catch (Exception e) {
    LOG.warn("clear screen command '" + clearScreenCmd + "' failed: " + e.toString()
      + ". resetting the clear screen command.");
    clearScreenCmd = null;
  }
}

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.terminal

@Override
  protected ArrayList<String> createArguments() {
    ArrayList<String> args = super.createArguments();
    if (!Util.isEmpty(cmd)) {
      String cmdargs[] = cmd.split("\\s");
      for (int i = 0; i < cmdargs.length; i++) {
        args.add(cmdargs[i]);
      }
    }
    return args;
  }
}

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.descriptor

private String getWorkaroundFormat(TYPE fromValue) {
  return !Util.isEmpty(format) && !format.equals("Object") ? format : FormatUtil.getDefaultFormat(fromValue,
    false).format(fromValue);//Util.asString(fromValue);
}

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.cursus

@Override
public Object getName() {
  return Util.isEmpty(exsecutios) ? toString() : exsecutios.iterator().next().getName();
}
@Override

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.terminal

/**
 * add a new item
 * 
 * @param nodes node list to add the new item to
 * @param item to be added
 */
public static <T> void add(List<AItem<T>> nodes, Properties item) {
  try {
    AItem instance = BeanClass.createInstance(item.getProperty(TYPE));
    int index = !Util.isEmpty(item.get(INDEX)) ? Integer.valueOf((String) item.get(INDEX)) : nodes.size();
    item.remove(TYPE);
    item.remove(INDEX);
    nodes.add(index, PrivateAccessor.assign(instance, item, false));
  } finally {
    item.clear();
  }
}

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.directaccess

private ResultSet getTableNames(Connection con) throws SQLException {
  String schema = !Util.isEmpty(persistence.getDefaultSchema()) ? persistence.getDefaultSchema() : null;
  ResultSet tables = con.getMetaData().getTables(null, schema, null, null);
  return tables;
}

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.terminal

public void changeItem() {
  try {
    AItem selectedItem = nodes.get(getSelectedIndex());
    int index = !Util.isEmpty(item.get(NEWINDEX)) ? Integer.valueOf((String) item.get(NEWINDEX)) : -1;
    item.remove(TYPE);
    item.remove(INDEX);
    item.remove(NEWINDEX);
    PrivateAccessor.assign(selectedItem, item, false);
    if (index != -1) {
      nodes.remove(selectedItem);
      nodes.add(index - 1, selectedItem);
    }
  } finally {
    item.clear();
  }
}

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.terminal

@Override
  protected String getValueText() {
    return Util.isEmpty(properties) ? super.getValueText() : StringUtil.toString(properties, 40);
  }
}

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.cursus

@Transient
public ERes getRes() {
  //TODO: check, if exsecutios have different rei
  return !Util.isEmpty(getExsecutios()) ? getExsecutios().iterator().next().getMutatio().getRes() : null;
}
@Override

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.descriptor

@Override
  public String toString() {
    Comparable<T> min = getMinimum(), max = getMaximum();
    Collection<T> allowedValues = getAllowedValues();
    Class<T> type = getType();
    Format format = getFormat();
    
    Object _min = min != null ? min : (!Util.isEmpty(allowedValues) ? allowedValues.iterator().next() : null);
    Object _max =
      max != null ? max : (!Util.isEmpty(allowedValues) ? new LinkedList<T>(allowedValues).getLast() : null);
    return Util.toString(this.getClass(), type, "length: " + getLength(), "mandatory: " + !isNullable(), "\n\trange: " + _min
      + (allowedValues != null ? " ... " : " - ") + _max,
      "\n\tformat: " + format);
  }
}

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.directaccess

public boolean isLocalDatabase(Persistence persistence) {
  String url = persistence.getConnectionUrl();
  if (!Util.isEmpty(persistence.getPort()) || isH2(url)) {
    return Arrays.asList(persistence.STD_LOCAL_DATABASE_DRIVERS).contains(
      persistence.getConnectionDriverClass())
      && (url.contains("localhost") || url.contains("127.0.0.1") || isH2(url));
  }
  return false;
}

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.directaccess

public boolean canConnectToLocalDatabase(Persistence persistence) {
  if (!Util.isEmpty(persistence.getPort())) {
    int p = Integer.valueOf(persistence.getPort());
    return NetUtil.isOpen(p);
  }
  return false;
}

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.cursus

@SuppressWarnings("unchecked")
public Set<? extends Res<O, V>> createParts() {
  return !Util.isEmpty(validObjectIDs) ? createNewParts(validObjectIDs.toArray()) 
      : genRes.getObjectid().toString().contains(WILDCARD) ? null 
          : MapUtil.asSet(createResForId(genRes.getObjectid()));
}
public Set<Res<O, V>> createNewParts(Object... objectIds) {

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.descriptor

public static Object transformEmptyToVoid(IAction a, int parameterIndex, Object value) {
    if (a instanceof MethodAction) {
      MethodAction ma = (MethodAction)a;
      Constraint c = ma.getConstraints() != null && ma.getConstraints().length > parameterIndex ? ma.getConstraints()[parameterIndex] : null;
      if (c != null && c.getAllowedValues() != null && c.getAllowedValues().contains(Void.class.getName()))
        return value instanceof String && Util.isEmpty(value) ? NULL_CLASS : value;
    }
    return value;
  }
}

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.terminal

@Override
public IItem react(IItem caller, String input, InputStream in, PrintStream out, Properties env) {
  if (Util.isEmpty(input)) {
    input = StringUtil.toString(getValue());
  }
  return super.react(caller, input, in, out, env);
}

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.terminal

@Override
public IItem react(IItem caller, String input, InputStream in, PrintStream out, Properties env) {
  if (!Util.isEmpty(input)) {
    env.put(getName(), getValue());
  } else {
    env.remove(getName());
  }
  changed = !changed;
  return caller == this ? getParent().next(in, out, env) : caller;
}

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.descriptor

protected long count() {
  long count = -1;
  try {
    count =
      !Util.isEmpty(collection) ? collection.size() : BeanContainer.instance().isPersistable(getType())
        ? BeanContainer.getCount(getType()) : -1;
  } catch (Exception ex) {
    LOG.warn(getName() + " is declared as @ENTITY but has no mapped TABLE --> can't evaluate count(*)!");
  }
  if (count != lastCount)
    asString = null;
  lastCount = count;
  return lastCount;
}

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.descriptor

/**
 * the bean is selectable, if it has at least one action to do on it - or it has a default-constructor or is
 * persistable.
 * 
 * @return true, if an action was defined
 */
public boolean isSelectable() {
  return !isFinal()
    && (isMultiValue() || isInterface() || isCreatable() || isPersistable()
      || Map.Entry.class.isAssignableFrom(getClazz()) || !Util.isEmpty(actions));
}

相关文章