Ejemplo n.º 1
0
  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);
  }
  private ObjectSpecification loadSpecificationForSubstitutedClass(final Class<?> type) {
    Assert.assertNotNull(type);
    final String typeName = type.getName();

    final SpecificationCacheDefault specificationCache = getCache();
    synchronized (specificationCache) {
      final ObjectSpecification spec = specificationCache.get(typeName);
      if (spec != null) {
        return spec;
      }
      final ObjectSpecification specification = createSpecification(type);
      if (specification == null) {
        throw new IsisException("Failed to create specification for class " + typeName);
      }

      // put into the cache prior to introspecting, to prevent
      // infinite loops
      specificationCache.cache(typeName, specification);

      introspectIfRequired(specification);

      return specification;
    }
  }
Ejemplo n.º 3
0
 public ViewRequirement(final Content content, int status) {
   Assert.assertNotNull(content);
   this.content = content;
   this.status = status;
   status = CLOSED;
 }