if ( (null != name) && (null != value) ) { IOption tempOption = this.getOption(name);  if ( null != tempOption ) { if ( !tempOption.getValue().toString().equals(value.toString()) ) { try { switch ( tempOption.getType() ) { case IOption.STRING: tempOption.setValue((String)value); break;  case IOption.BOOLEAN: tempOption.setValue(new Boolean(value.toString())); break;  case IOption.INTEGER: tempOption.setValue(new Integer(value.toString())); break;  case IOption.FLOAT: tempOption.setValue(new Float(value.toString())); break; }  System.out.println("Set option '" + name + "' to '" + value + "'.");  option = tempOption; } catch ( IllegalArgumentException iaEx ) { System.out.println("Error trying to load option '" + name + "' with a value of '" + value + "'."); } } } else { System.out.println("Invalid option '" + name + "' when trying to load options file."); } } }
    private IOption parseOptionNode(ParsedXML node) {      IOption option = null;            if ( node.getName().equals("gameoption") ) { //$NON-NLS-1$        Enumeration children = node.elements();        String name = null;        Object value = null;                while (children.hasMoreElements()) {          ParsedXML child = (ParsedXML)children.nextElement();                    if ( child.getName().equals("optionname") ) { //$NON-NLS-1$            name = ((ParsedXML)child.elements().nextElement()).getContent();          } else if ( child.getName().equals("optionvalue") ) { //$NON-NLS-1$            value = ((ParsedXML)child.elements().nextElement()).getContent();          }        }                if ( (null != name) && (null != value) ) {          IOption tempOption = this.getOption(name);                    if ( null != tempOption ) {            if ( !tempOption.getValue().toString().equals(value.toString()) ) {              try {                switch ( tempOption.getType() ) {                  case IOption.STRING:                    tempOption.setValue((String)value);                    break;                                      case IOption.BOOLEAN:                    tempOption.setValue(new Boolean(value.toString()));                    break;                                      case IOption.INTEGER:                    tempOption.setValue(new Integer(value.toString()));                    break;                                      case IOption.FLOAT:                    tempOption.setValue(new Float(value.toString()));                    break;                }                                System.out.println("Set option '" + name + "' to '" + value + "'."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$                                option = tempOption;              } catch ( IllegalArgumentException iaEx ) {                System.out.println("Error trying to load option '" + name + "' with a value of '" + value + "'."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$              }            }          } else {            System.out.println("Invalid option '" + name + "' when trying to load options file."); //$NON-NLS-1$ //$NON-NLS-2$          }        }      }            return option;    }