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

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

本文整理了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

  1. /**
  2. * @return Returns the defaultSchema.
  3. */
  4. public String getDefaultSchema() {
  5. if (Util.isEmpty(defaultSchema) && !Util.isEmpty(connectionUserName)) {
  6. defaultSchema = connectionUserName.toUpperCase();
  7. }
  8. return defaultSchema;
  9. }

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

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

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

  1. private void clearScreeen() {
  2. try {
  3. if (!Util.isEmpty(clearScreenCmd))
  4. SystemUtil.execute(clearScreenCmd);
  5. } catch (Exception e) {
  6. LOG.warn("clear screen command '" + clearScreenCmd + "' failed: " + e.toString()
  7. + ". resetting the clear screen command.");
  8. clearScreenCmd = null;
  9. }
  10. }

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

  1. @Override
  2. protected ArrayList<String> createArguments() {
  3. ArrayList<String> args = super.createArguments();
  4. if (!Util.isEmpty(cmd)) {
  5. String cmdargs[] = cmd.split("\\s");
  6. for (int i = 0; i < cmdargs.length; i++) {
  7. args.add(cmdargs[i]);
  8. }
  9. }
  10. return args;
  11. }
  12. }

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

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

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

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

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

  1. /**
  2. * add a new item
  3. *
  4. * @param nodes node list to add the new item to
  5. * @param item to be added
  6. */
  7. public static <T> void add(List<AItem<T>> nodes, Properties item) {
  8. try {
  9. AItem instance = BeanClass.createInstance(item.getProperty(TYPE));
  10. int index = !Util.isEmpty(item.get(INDEX)) ? Integer.valueOf((String) item.get(INDEX)) : nodes.size();
  11. item.remove(TYPE);
  12. item.remove(INDEX);
  13. nodes.add(index, PrivateAccessor.assign(instance, item, false));
  14. } finally {
  15. item.clear();
  16. }
  17. }

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

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

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

  1. public void changeItem() {
  2. try {
  3. AItem selectedItem = nodes.get(getSelectedIndex());
  4. int index = !Util.isEmpty(item.get(NEWINDEX)) ? Integer.valueOf((String) item.get(NEWINDEX)) : -1;
  5. item.remove(TYPE);
  6. item.remove(INDEX);
  7. item.remove(NEWINDEX);
  8. PrivateAccessor.assign(selectedItem, item, false);
  9. if (index != -1) {
  10. nodes.remove(selectedItem);
  11. nodes.add(index - 1, selectedItem);
  12. }
  13. } finally {
  14. item.clear();
  15. }
  16. }

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

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

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

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

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

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

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

  1. public boolean isLocalDatabase(Persistence persistence) {
  2. String url = persistence.getConnectionUrl();
  3. if (!Util.isEmpty(persistence.getPort()) || isH2(url)) {
  4. return Arrays.asList(persistence.STD_LOCAL_DATABASE_DRIVERS).contains(
  5. persistence.getConnectionDriverClass())
  6. && (url.contains("localhost") || url.contains("127.0.0.1") || isH2(url));
  7. }
  8. return false;
  9. }

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

  1. public boolean canConnectToLocalDatabase(Persistence persistence) {
  2. if (!Util.isEmpty(persistence.getPort())) {
  3. int p = Integer.valueOf(persistence.getPort());
  4. return NetUtil.isOpen(p);
  5. }
  6. return false;
  7. }

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

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

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

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

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

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

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

  1. @Override
  2. public IItem react(IItem caller, String input, InputStream in, PrintStream out, Properties env) {
  3. if (!Util.isEmpty(input)) {
  4. env.put(getName(), getValue());
  5. } else {
  6. env.remove(getName());
  7. }
  8. changed = !changed;
  9. return caller == this ? getParent().next(in, out, env) : caller;
  10. }

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

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

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

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

相关文章