コード例 #1
0
  public static void writeGlobalLayoutExpressions(
      final WriteableDocumentBundle bundle, final BundleWriterState state, final XmlWriter writer)
      throws IOException, BundleWriterException {
    if (state == null) {
      throw new NullPointerException();
    }
    if (writer == null) {
      throw new NullPointerException();
    }
    if (bundle == null) {
      throw new NullPointerException();
    }

    final ExpressionCollection exp = state.getReport().getExpressions();
    final ExpressionRegistry registry = ExpressionRegistry.getInstance();
    for (int i = 0; i < exp.size(); i++) {
      final Expression expression = exp.getExpression(i);
      if (registry.isExpressionRegistered(expression.getClass().getName()) == false) {
        continue;
      }

      final ExpressionMetaData emd =
          registry.getExpressionMetaData(expression.getClass().getName());
      if (emd.isGlobalLayoutProcessor()) {
        writeExpression(
            bundle, state, expression, writer, BundleNamespaces.LAYOUT, "expression"); // NON-NLS
      }
    }
  }
コード例 #2
0
  public static boolean isGlobalLayoutExpressionActive(final BundleWriterState state) {
    if (state == null) {
      throw new NullPointerException();
    }

    final ExpressionCollection exp = state.getReport().getExpressions();
    final ExpressionRegistry registry = ExpressionRegistry.getInstance();
    for (int i = 0; i < exp.size(); i++) {
      final Expression expression = exp.getExpression(i);
      if (registry.isExpressionRegistered(expression.getClass().getName()) == false) {
        continue;
      }

      final ExpressionMetaData emd =
          registry.getExpressionMetaData(expression.getClass().getName());
      if (emd.isGlobalLayoutProcessor()) {
        return true;
      }
    }
    return false;
  }