code: protected boolean convertToBoolean(final Object fromStack) throws ParseException
      {
          if (fromStack instanceof Number)
              /*
               * 0 is the only number that is false, all others are true.
               */
              return ((Number) fromStack).intValue() != 0;
          if (fromStack instanceof String)
              return Boolean.parseBoolean((String) fromStack);
          if (fromStack instanceof Boolean)
              return (Boolean) fromStack;
  
          final StringBuilder errMsg = new StringBuilder();
          errMsg.append("invalid type ");
          errMsg.append(fromStack.getClass().getSimpleName());
          throw new ParseException(errMsg.toString(), 0);
      }
docs: <p>
  convertToBoolean.
  </p>
  
  @param fromStack a {@link java.lang.Object} object.
  @return a boolean.
  @throws java.text.ParseException if any.