Exemplo n.º 1
0
        @Override
        public void text(UnmarshallingContext.State state, CharSequence text) throws SAXException {
          List<Object> r = new FinalArrayList<Object>();

          int idx = 0;
          int len = text.length();

          while (true) {
            int p = idx;
            while (p < len && !WhiteSpaceProcessor.isWhiteSpace(text.charAt(p))) p++;

            CharSequence token = text.subSequence(idx, p);
            if (!token.equals(""))
              try {
                r.add(xducer.parse(token));
              } catch (AccessorException e) {
                handleGenericException(e, true);
                continue; // move on to next
              }

            if (p == len) break; // done

            while (p < len && WhiteSpaceProcessor.isWhiteSpace(text.charAt(p))) p++;
            if (p == len) break; // done

            idx = p;
          }

          state.target = toArray(r);
        }