Ejemplo n.º 1
0
 /**
  * Creates a copy of the internal list of parameters. The list items are represented as String.
  *
  * @return List of String
  * @throws TextCommandParserException If list contains a parameter with wrong type.
  */
 public List toStringList() throws TextCommandParserException {
   try {
     List stringList = new ArrayList(size());
     Iterator it = iterator();
     while (it.hasNext()) {
       ValueParameter p = (ValueParameter) it.next();
       stringList.add(p.getStringValue());
     }
     return stringList;
   } catch (ClassCastException e) {
     throw new TextCommandParserException("Parameter in the list has wrong type.");
   }
 }
Ejemplo n.º 2
0
 /**
  * Creates a copy of the internal list of parameters. The list items are represented as <code>
  * byte[]</code> used in <source>source.writeID(...)</code>.
  *
  * @return List of <code>byte[]</code>
  * @throws TextCommandParserException If list contains a parameter with wrong type.
  * @throws JAXBException If list contains a parameter with wrong type.
  */
 public List toHexStringListType() throws TextCommandParserException {
   try {
     List hexList = new ArrayList(size());
     Iterator it = iterator();
     while (it.hasNext()) {
       ValueParameter p = (ValueParameter) it.next();
       byte[] hexArray = HexUtil.hexToByteArray(p.getStringValue());
       hexList.add(hexArray);
     }
     return hexList;
   } catch (ClassCastException e) {
     throw new TextCommandParserException("Parameter in the list has wrong type.");
   }
 }