Esempio n. 1
0
  /**
   * Generates the content for this tag by appending it to the provided tag.
   *
   * @param templateEntry The entry for which this tag is being generated.
   * @param templateValue The template value to which the generated content should be appended.
   * @return The result of generating content for this tag.
   */
  public TagResult generateValue(TemplateEntry templateEntry, TemplateValue templateValue) {
    List<TemplateValue> values = templateEntry.getValues(attributeType);
    if ((values == null) || values.isEmpty()) {
      return TagResult.OMIT_FROM_ENTRY;
    }

    if (assertionValue == null) {
      return TagResult.SUCCESS_RESULT;
    } else {
      for (TemplateValue v : values) {
        if (assertionValue.equals(v.getValue().toString())) {
          return TagResult.SUCCESS_RESULT;
        }
      }

      return TagResult.OMIT_FROM_ENTRY;
    }
  }
Esempio n. 2
0
 /**
  * Generates the content for this tag by appending it to the provided tag.
  *
  * @param templateEntry The entry for which this tag is being generated.
  * @param templateValue The template value to which the generated content should be appended.
  * @return The result of generating content for this tag.
  */
 public TagResult generateValue(TemplateEntry templateEntry, TemplateValue templateValue) {
   templateValue.append(UUID.randomUUID().toString());
   return TagResult.SUCCESS_RESULT;
 }