public void initialize(UimaContext uimaContext) throws ResourceInitializationException {
    super.initialize(uimaContext);
    if (windowTypeName != null)
      windowClass = InitializableFactory.getClass(windowTypeName, Annotation.class);

    if (leftParenthesis.length() != 1) {
      throw CleartkInitializationException.notSingleCharacter(
          PARAM_LEFT_PARENTHESIS, leftParenthesis);
    }
    leftParen = leftParenthesis.charAt(0);

    if (rightParenthesis.length() != 1) {
      throw CleartkInitializationException.notSingleCharacter(
          PARAM_RIGHT_PARENTHESIS, rightParenthesis);
    }
    rightParen = rightParenthesis.charAt(0);

    Class<? extends Annotation> parentheticalClass =
        InitializableFactory.getClass(parentheticalTypeName, Annotation.class);

    try {
      parentheticalConstructor =
          parentheticalClass.getConstructor(new Class[] {JCas.class, Integer.TYPE, Integer.TYPE});
    } catch (Exception e) {
      throw new ResourceInitializationException(e);
    }
  }
Exemplo n.º 2
0
 public void initialize(UimaContext context) throws ResourceInitializationException {
   ConfigurationParameterInitializer.initialize(this, context);
   if (stackSize < 1) {
     throw CleartkInitializationException.parameterLessThan(PARAM_STACK_SIZE, 1, stackSize);
   }
 }