org.nakedobjects.noa.spec.NakedObjectSpecification.getShortName()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(69)

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

NakedObjectSpecification.getShortName介绍

[英]Returns the class name without the package. Removes the text up to, and including the last period (".").
[中]返回不带包的类名。删除最后一个句点(“.”)之前的文本。

代码示例

代码示例来源:origin: org.nakedobjects/nos-viewer-dnd

public String getDescription() {
  String title = object == null ? "" : ": " + object.titleString();
  String type = name.indexOf(specification.getShortName()) == -1 ? "" : " (" + specification.getShortName() + ")";
  return name + type + title + " " + description;
}

代码示例来源:origin: org.nakedobjects/nos-viewer-dnd

public String getDescription() {
  String title = object == null ? "" : ": " + object.titleString();
  String type = name.indexOf(specification.getShortName()) == -1 ? " (" + specification.getShortName() + ")" : "";
  return name + type + title + " " + description;
}

代码示例来源:origin: org.nakedobjects/nof-persistor

/**
 * Checks whether there are any instances of the specified type. The object store should look for
 * instances of the type represented by <variable>type </variable> and return <code>true</code> if there
 * are, or <code>false</code> if there are not.
 */
public boolean hasInstances(final NakedObjectSpecification specification, final boolean includeSubclasses) {
  LOG.info("hasInstances of " + specification.getShortName());
  return objectStore.hasInstances(specification, includeSubclasses);
}

代码示例来源:origin: org.nakedobjects/nos-viewer-dnd

public int compare(final NakedObject sortedElement) {
  String sortedType = sortedElement.getSpecification().getShortName();
  return sortedType.compareTo(type);
}

代码示例来源:origin: org.nakedobjects/nos-viewer-dnd

public int compare(final NakedObject sortedElement) {
  String sortedType = sortedElement.getSpecification().getShortName();
  return sortedType.compareTo(type);
}

代码示例来源:origin: org.nakedobjects/nos-viewer-dnd

public void init(final NakedObject element) {
  type = element.getSpecification().getShortName();
}

代码示例来源:origin: org.nakedobjects/nos-viewer-dnd

public String windowTitle() {
  return getSpecification().getShortName();
}

代码示例来源:origin: org.nakedobjects/nos-viewer-dnd

public void init(final NakedObject element) {
  type = element.getSpecification().getShortName();
}

代码示例来源:origin: org.nakedobjects/nos-viewer-dnd

private Image findIconWithShortName(final NakedObjectSpecification specification, final int iconHeight, final Color tint) {
  String className = specification.getShortName().replace('.', '_');
  Image loadIcon = loadIcon(className, iconHeight, tint);
  if (loadIcon == null) {
    loadIcon = findIconForSuperClass(specification, iconHeight, tint);
  }
  return loadIcon;
}

代码示例来源:origin: org.nakedobjects/nof-persistor

public boolean hasInstances(final NakedObjectSpecification specification, final boolean includeSubclasses)
    throws ObjectPersistenceException {
  boolean hasInstances = decorated.hasInstances(specification, includeSubclasses);
  log("Has instances of " + specification.getShortName(), "" + hasInstances);
  return hasInstances;
}

代码示例来源:origin: org.nakedobjects/nos-viewer-dnd

public String getDescription() {
  String title = valueAdapter == null ? "" :  ": " + valueAdapter.titleString();
  String name = field.getName();
  NakedObjectSpecification specification = getSpecification();
  String type = name.indexOf(specification .getShortName()) == -1 ? "" : " (" + specification.getShortName() + ")";
  String description = getValueAssociation().getDescription();
  return name + type + title + " " + description;
}

代码示例来源:origin: org.nakedobjects/nof-persistor

private void save(final NakedObject object) throws ObjectPersistenceException {
  NakedObjectSpecification specification = object.getSpecification();
  LOG.debug("   saving object " + object + " as instance of " + specification.getShortName());
  MemoryObjectStoreInstances ins = instancesFor(specification);
  ins.save(object);
}

代码示例来源:origin: org.nakedobjects/nof-persistor

public NakedObject getObject(final Oid oid, final NakedObjectSpecification hint) throws ObjectNotFoundException,
    ObjectPersistenceException {
  NakedObject object = decorated.getObject(oid, hint);
  log("Get object for " + oid + " (of type " + hint.getShortName() + ")", object.getObject());
  return object;
}

代码示例来源:origin: org.nakedobjects/nos-viewer-dnd

public Consent canSet(final NakedObject dragSource) {
  if (dragSource.getSpecification().isOfType(specification)) {
    return Allow.DEFAULT;
  } else {
    return new Veto("Object must be " + specification.getShortName());
  }
}

代码示例来源:origin: org.nakedobjects/nof-persistor

private void destroy(final NakedObject object) {
  NakedObjectSpecification specification = object.getSpecification();
  LOG.debug("   destroy object " + object + " as instance of " + specification.getShortName());
  MemoryObjectStoreInstances ins = instancesFor(specification);
  ins.remove(object.getOid());
}

代码示例来源:origin: org.nakedobjects/nof-reflector-core

public String toString() {
  ToString str = new ToString(this);
  str.append(super.toString());
  str.setAddComma();
  str.append("persisted", isPersisted());
  str.append("type", getSpecification().getShortName());
  return str.toString();
}

代码示例来源:origin: org.nakedobjects/nof-reflector-core

public String toString() {
  ToString str = new ToString(this);
  str.append(super.toString());
  str.setAddComma();
  str.append("persisted", isPersisted());
  str.append("type", getSpecification().getShortName());
  return str.toString();
}

代码示例来源:origin: org.nakedobjects/nof-persistor

public void resolveImmediately(final NakedObject object) {
  ResolveState resolveState = object.getResolveState();
  if (resolveState.isResolvable(ResolveState.RESOLVING)) {
    Assert.assertFalse("only resolve object that is not yet resolved", object, object.getResolveState().isResolved());
    Assert.assertTrue("only resolve object that is persistent", object, object.getResolveState().isPersistent());
    if (LOG.isInfoEnabled()) {
      // don't log object - it's toString() may use the unresolved field, or unresolved collection
      LOG.info("resolve immediately: " + object.getSpecification().getShortName() + " "+ object.getResolveState().code() + " " + object.getOid());
    }
    object.getSpecification().lifecycleEvent(object, NakedObjectSpecification.LOADING);
    objectStore.resolveImmediately(object);
    object.getSpecification().lifecycleEvent(object, NakedObjectSpecification.LOADED);
  }
}

代码示例来源:origin: org.nakedobjects/nof-reflector-core

public String toString() {
  ToString str = new ToString(this);
  str.append(super.toString());
  str.append(",");
  str.append("persisted", isPersisted());
  str.append("type", getSpecification() == null ? "unknown" : getSpecification().getShortName());
  return str.toString();
}

代码示例来源:origin: org.nakedobjects/nos-viewer-dnd

public Consent disabled(final View view) {
  NakedValue value = getValue(view);
  ValueContent field = (ValueContent) view.getContent();
  Consent changable = view.canChangeValue();
  if (changable.isVetoed()) {
    return changable;
  } else if (!field.canClear()) {
    return new Veto("Can't clear " + value.getSpecification().getShortName() + " values");
  } else if (isEmpty(view)) {
    return new Veto("Field is already empty");
  } else {
    return new Allow("Clear value " + value.titleString());
  }
}

相关文章