org.nakedobjects.metamodel.commons.ensure.Assert.assertNotNull()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(157)

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

Assert.assertNotNull介绍

暂无

代码示例

代码示例来源:origin: org.nakedobjects.core/metamodel

public void injectDependencies(final Object object) {
  Assert.assertNotNull("no container", container);
  Assert.assertNotNull("no services", services);
  
  ArrayList<Object> servicesCopy = new ArrayList<Object>(services);
  servicesCopy.add(container);
  injectServices(object, servicesCopy);
}

代码示例来源:origin: org.nakedobjects/metamodel

public void injectDependencies(final Object object) {
  Assert.assertNotNull("no container", container);
  Assert.assertNotNull("no services", services);
  
  ArrayList<Object> servicesCopy = new ArrayList<Object>(services);
  servicesCopy.add(container);
  injectServices(object, servicesCopy);
}

代码示例来源:origin: org.nakedobjects/metamodel

public AggregatedOid(final Oid oid, final String id) {
  Assert.assertNotNull("Field required", id);
  this.parentOid = oid;
  this.fieldName = id;
  initialized();
}

代码示例来源:origin: org.nakedobjects.core/metamodel

public AggregatedOid(final Oid oid, final String id) {
  Assert.assertNotNull("Field required", id);
  this.parentOid = oid;
  this.fieldName = id;
  initialized();
}

代码示例来源:origin: org.nakedobjects/remoting

public final ReferenceData serializeAdapter(
    final NakedObject adapter,
    final int depth,
    final KnownObjectsRequest knownObjects) {
  Assert.assertNotNull(adapter);
  return (ReferenceData) serializeObject2(adapter, depth, knownObjects);
}

代码示例来源:origin: org.nakedobjects/metamodel

public static Class<?> loadClass(
    String className) {
  Assert.assertNotNull("Class to instantiate must be specified", className);
  try {
    return Thread.currentThread().getContextClassLoader().loadClass(className);
  } catch (final ClassNotFoundException e) {
    throw new UnavailableClassException("The default type '" + className + "' cannot be found");
  } catch (final NoClassDefFoundError e) {
    throw new InstanceCreationClassException("Default type '" + className + "' found, but is missing a dependent class: " + e.getMessage(), e);
  }
}

代码示例来源:origin: org.nakedobjects.core/metamodel

public static Class<?> loadClass(
    String className) {
  Assert.assertNotNull("Class to instantiate must be specified", className);
  try {
    return Thread.currentThread().getContextClassLoader().loadClass(className);
  } catch (final ClassNotFoundException e) {
    throw new UnavailableClassException("The default type '" + className + "' cannot be found");
  } catch (final NoClassDefFoundError e) {
    throw new InstanceCreationClassException("Default type '" + className + "' found, but is missing a dependent class: " + e.getMessage(), e);
  }
}

代码示例来源:origin: org.nakedobjects.plugins/htmlviewer-viewer

private String addToMap(final Map map, final Object object) {
  Assert.assertNotNull(object);
  if (map.containsValue(object)) {
    return findExistingId(map, object);
  } else {
    return mapNewObject(map, object);
  }
}

代码示例来源:origin: org.nakedobjects.plugins/html-viewer

private String addToMap(final Map map, final Object object) {
  Assert.assertNotNull(object);
  if (map.containsValue(object)) {
    return findExistingId(map, object);
  } else {
    return mapNewObject(map, object);
  }
}

代码示例来源:origin: org.nakedobjects.core/runtime

@SuppressWarnings("unchecked")
public <T extends Installer> T getInstaller(final Class<T> cls, final String implName) {
  Assert.assertNotNull("No name specified", implName);
  for (final Installer installer : installerList) {
    if (cls.isAssignableFrom(installer.getClass()) && installer.getName().equals(implName)) {
      mergeConfigurationFor(installer);
      injectDependenciesInto(installer);
      return (T) installer;
    }
  }
  return (T) getInstaller(implName);
}

代码示例来源:origin: org.nakedobjects.plugins/htmlviewer-viewer

public void addTaskCrumb(final Task task) {
  while (crumbs.size() > 1 && !(crumbs.lastElement() instanceof ObjectCrumb)) {
    crumbs.pop();
  }
  Assert.assertNotNull(task);
  Assert.assertTrue(!isTask());
  task.init(this);
  crumbs.push(new TaskCrumb(task));
}

代码示例来源:origin: org.nakedobjects.plugins/dndviewer

public void insert(final CursorPosition cursorAt, final String characters) {
  Assert.assertNotNull(cursorAt);
  final BlockToLineMapping block = findBlockFor(cursorAt.getLine());
  Assert.assertNotNull("failed to get block for line " + cursorAt.getLine(), block);
  block.textBlock.insert(block.line, cursorAt.getCharacter(), characters);
}

代码示例来源:origin: org.nakedobjects.plugins/html-viewer

public void addTaskCrumb(final Task task) {
  while (crumbs.size() > 1 && !(crumbs.lastElement() instanceof ObjectCrumb)) {
    crumbs.pop();
  }
  Assert.assertNotNull(task);
  Assert.assertTrue(!isTask());
  task.init(this);
  crumbs.push(new TaskCrumb(task));
}

代码示例来源:origin: org.nakedobjects/xmlpersistence

public void resolveImmediately(final NakedObject object) {
  final ObjectData data = (ObjectData) dataManager.loadData((SerialOid) object.getOid());
  Assert.assertNotNull("Not able to read in data during resolve", object, data);
  initObject(object, data);
}

代码示例来源:origin: org.nakedobjects.core/runtime

private NakedObject map(final AggregateAdapters aggregateAdapters) {
  Assert.assertNotNull(aggregateAdapters);
  NakedObject adapter = aggregateAdapters.getRootAdapter();
  mapAndInjectServices(adapter);
  for(NakedObject collectionAdapter: aggregateAdapters) {
    mapAndInjectServices(collectionAdapter);
  }
  return adapter;
}

代码示例来源:origin: org.nakedobjects.core/remoting

private Data createMadePersistentCollection(final CollectionData collectionData, final NakedObject collection) {
  final ReferenceData[] elementData = collectionData.getElements();
  final CollectionFacet facet = CollectionFacetUtils.getCollectionFacetFromSpec(collection);
  final Iterator elements = facet.iterator(collection);
  for (int i = 0; i < elementData.length; i++) {
    final NakedObject element = (NakedObject) elements.next();
    final Oid oid = element.getOid();
    Assert.assertNotNull(oid);
    elementData[i] = encodeMadePersistentGraph((ObjectData) elementData[i], element);
  }
  return collectionData;
}

代码示例来源:origin: org.nakedobjects/remoting

private Data createMadePersistentCollection(final CollectionData collectionData, final NakedObject collection) {
  final ReferenceData[] elementData = collectionData.getElements();
  final CollectionFacet facet = CollectionFacetUtils.getCollectionFacetFromSpec(collection);
  final Iterator elements = facet.iterator(collection);
  for (int i = 0; i < elementData.length; i++) {
    final NakedObject element = (NakedObject) elements.next();
    final Oid oid = element.getOid();
    Assert.assertNotNull(oid);
    elementData[i] = encodeMadePersistentGraph((ObjectData) elementData[i], element);
  }
  return collectionData;
}

代码示例来源:origin: org.nakedobjects/metamodel

public NakedObject fromEncodedString(final String encodedData) {
  Assert.assertNotNull(encodedData);
  if (ENCODED_NULL.equals(encodedData)) {
    return null;
  } else {
    getRuntimeContext().injectDependenciesInto(encoderDecoder);
    Object decodedObject = encoderDecoder.fromEncodedString(encodedData);
    return getRuntimeContext().adapterFor(decodedObject);
  }
}

代码示例来源:origin: org.nakedobjects.core/remoting

private NakedObject getPersistentNakedObject(final ReferenceData object) {
  final NakedObjectSpecification spec = getSpecification(object.getType());
  final NakedObject obj = getPersistenceSession().loadObject(object.getOid(), spec);
  Assert.assertNotNull(obj);
  return obj;
}

代码示例来源:origin: org.nakedobjects.core/remoting

/**
 * Creates a ReferenceData that contains the type, version and OID for the specified object. This can only
 * be used for persistent objects.
 * 
 * <p>
 * Called both client and server-side, in multiple locations. 
 */
public final IdentityData encodeIdentityData(final NakedObject object) {
  Assert.assertNotNull("OID needed for reference", object, object.getOid());
  return dataFactory.createIdentityData(object.getSpecification().getFullName(), object.getOid(), object.getVersion());
}

相关文章