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); }
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); }
public AggregatedOid(final Oid oid, final String id) { Assert.assertNotNull("Field required", id); this.parentOid = oid; this.fieldName = id; initialized(); }
public AggregatedOid(final Oid oid, final String id) { Assert.assertNotNull("Field required", id); this.parentOid = oid; this.fieldName = id; initialized(); }
public final ReferenceData serializeAdapter( final NakedObject adapter, final int depth, final KnownObjectsRequest knownObjects) { Assert.assertNotNull(adapter); return (ReferenceData) serializeObject2(adapter, depth, knownObjects); }
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); } }
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); } }
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); } }
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); } }
@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); }
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)); }
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); }
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)); }
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); }
private NakedObject map(final AggregateAdapters aggregateAdapters) { Assert.assertNotNull(aggregateAdapters); NakedObject adapter = aggregateAdapters.getRootAdapter(); mapAndInjectServices(adapter); for(NakedObject collectionAdapter: aggregateAdapters) { mapAndInjectServices(collectionAdapter); } return adapter; }
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; }
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; }
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); } }
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; }
/** * 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()); }