コード例 #1
0
ファイル: TextContent.java プロジェクト: adamhoward/isis
  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);
  }
コード例 #2
0
  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;
    }
  }
コード例 #3
0
ファイル: ViewRequirement.java プロジェクト: coffeefoam/isis
 public ViewRequirement(final Content content, int status) {
   Assert.assertNotNull(content);
   this.content = content;
   this.status = status;
   status = CLOSED;
 }