示例#1
0
 /**
  * Adds <code>value</code> as an element called <code>name</code>.
  *
  * <p>The legal value(s) for <code>name</code> are defined in {@link #getElement}.
  */
 public void addElement(java.lang.String name, java.lang.Object value) {
   name = makeSubstitution(name, -1);
   switch (Arrays.binarySearch(NATIVE_ELEMENTS, name)) {
     case 0:
       setHdr((biz.c24.io.training.statements.Header) value);
       return;
     case 1:
       addStmtLine((biz.c24.io.training.statements.StatementLine) value);
       return;
     case 2:
       setTlr((biz.c24.io.training.statements.Trailer) value);
       return;
     default:
       super.addElement(name, value);
   }
 }
示例#2
0
 /**
  * Removes the element called <code>name</code> at <code>index</code>.
  *
  * <p>The legal value(s) for <code>name</code> are defined in {@link #getElement}.
  */
 public void removeElement(java.lang.String name, int index) {
   name = unmakeSubstitution(name, index);
   switch (Arrays.binarySearch(NATIVE_ELEMENTS, name)) {
     case 0:
       setHdr(null);
       return;
     case 1:
       removeStmtLine(index);
       return;
     case 2:
       setTlr(null);
       return;
     default:
       super.removeElement(name, index);
   }
 }
示例#3
0
 /**
  * Sets <code>value</code> as an element called <code>name</code> at <code>index</code>.
  *
  * <p>The legal value(s) for <code>name</code> are defined in {@link #getElement}.
  */
 public void setElement(java.lang.String name, int index, java.lang.Object value) {
   name = makeSubstitution(name, index);
   switch (Arrays.binarySearch(NATIVE_ELEMENTS, name)) {
     case 0:
       setHdr((biz.c24.io.training.statements.Header) value);
       return;
     case 1:
       if (this.stmtLine == null) throw new java.lang.ArrayIndexOutOfBoundsException();
       else if (value == null) removeElement(name, index);
       else {
         this.stmtLine[index] = (biz.c24.io.training.statements.StatementLine) value;
         ((biz.c24.io.api.data.ComplexDataObject) this.stmtLine[index])
             .setParent(this, "StmtLine");
       }
       return;
     case 2:
       setTlr((biz.c24.io.training.statements.Trailer) value);
       return;
     default:
       super.setElement(name, index, value);
   }
 }