public void format(FormatterContext context, Collection updateTypes, String[] levels) {
   if (updateTypes.size() == 0) {
     return;
   }
   TagBuilder tag =
       new TagBuilder(context.getWriter(), "METADATA-UPDATE_TYPE")
           .appendAttribute("Resource", levels[RESOURCE_LEVEL])
           .appendAttribute("Class", levels[CLASS_LEVEL])
           .appendAttribute("Update", levels[UPDATE_LEVEL])
           .appendAttribute("Version", context.getVersion())
           .appendAttribute("Date", context.getDate())
           .beginContentOnNewLine()
           .appendColumns(COLUMNS);
   for (Iterator iterator = updateTypes.iterator(); iterator.hasNext(); ) {
     UpdateType updateType = (UpdateType) iterator.next();
     apppendDataRow(context, updateType);
   }
   tag.close();
 }
 public void format(PrintWriter out, List validationExternalTypes) {
   if (validationExternalTypes.size() == 0) {
     return;
   }
   TagBuilder tag = new TagBuilder(out);
   tag.begin("METADATA-VALIDATION_EXTERNAL_TYPE");
   tag.appendAttribute("Resource", mResourceName);
   tag.appendAttribute("ValidationExternal", mValidationExternalName);
   tag.appendAttribute("Version", mVersion);
   tag.appendAttribute("Date", mDate);
   tag.endAttributes();
   tag.appendColumns(sColumns);
   for (int i = 0; i < validationExternalTypes.size(); i++) {
     ValidationExternalType validationExternalType =
         (ValidationExternalType) validationExternalTypes.get(i);
     appendDataRow(out, validationExternalType);
   }
   tag.end();
 }
예제 #3
0
 /**
  * Insert a single annotated tag into the store, returning its unique name.
  *
  * @param builder the builder containing the proposed tag's data.
  * @return the name of the tag object.
  * @throws IOException the object could not be stored.
  */
 public final ObjectId insert(TagBuilder builder) throws IOException {
   return insert(Constants.OBJ_TAG, builder.build());
 }