コード例 #1
0
  /**
   * Initializes and wires up, and primes the cache based on any service classes that may have been
   * {@link #setServices(List) injected}.
   */
  @Override
  public void init() {

    ValidationFailures validationFailures = initAndValidate();

    validationFailures.assertNone();

    cacheBySpecId();
  }
コード例 #2
0
 @Override
 public void validateSpecifications(ValidationFailures validationFailures) {
   final Map<ObjectSpecId, ObjectSpecification> specById = Maps.newHashMap();
   for (final ObjectSpecification objSpec : allSpecifications()) {
     final ObjectSpecId objectSpecId = objSpec.getSpecId();
     if (objectSpecId == null) {
       continue;
     }
     final ObjectSpecification existingSpec = specById.put(objectSpecId, objSpec);
     if (existingSpec == null) {
       continue;
     }
     validationFailures.add(
         "Cannot have two entities with same object type (@ObjectType facet or equivalent) Value; "
             + "both %s and %s are annotated with value of ''%s''.",
         existingSpec.getFullIdentifier(), objSpec.getFullIdentifier(), objectSpecId);
   }
 }