Example #1
0
  /**
   * Prints the contents of the TRE to the given PrintStream
   *
   * @param stream PrintStream to print to
   * @throws NITFException
   */
  public void print(PrintStream stream) throws NITFException {
    stream.println("\n---------------" + getTag() + "---------------");

    for (TREIterator it = iterator(); it.hasNext(); ) {
      FieldPair pair = it.next();

      String desc = it.getFieldDescription();

      Field field = pair.getField();
      stream.println(
          pair.getName()
              + (desc != null ? (" (" + desc + ")") : "")
              + " = ["
              + (field.getType() == FieldType.NITF_BINARY
                  ? ("<binary stuff, length = " + field.getLength() + ">")
                  : field.toString())
              + "]");
    }

    stream.println("------------------------------------");
  }
Example #2
0
 public static void setDeclaredValue(Class<?> clazz, Object instance, FieldPair pair)
     throws Exception {
   setDeclaredValue(clazz, instance, pair.getName(), pair.getValue());
 }
Example #3
0
 public static void setDeclaredValue(
     String className, SubPackageType type, Object instance, FieldPair pair) throws Exception {
   setDeclaredValue(className, type, instance, pair.getName(), pair.getValue());
 }
Example #4
0
 public static void setValue(Object instance, FieldPair pair) throws Exception {
   setValue(instance, pair.getName(), pair.getValue());
 }