Package com.eviware.soapui.impl.rest

Examples of com.eviware.soapui.impl.rest.RestRepresentation


        public int getRowCount() {
            return data.size();
        }

        public Object getValueAt(int rowIndex, int columnIndex) {
            RestRepresentation representation = data.get(rowIndex);

            switch (columnIndex) {
                case 0:
                    return representation.getType().toString();
                case 1:
                    return representation.getMediaType();
                case 2:
                    return representation.getType().equals(RestRepresentation.Type.REQUEST) ? "n/a" : representation
                            .getStatus().toString();
                case 3:
                    return representation.getElement() == null ? null : representation.getElement().toString();
            }

            return null;
        }
View Full Code Here


        @Override
        public void setValueAt(Object value, int rowIndex, int columnIndex) {
            if (readOnly) {
                return;
            }
            RestRepresentation representation = data.get(rowIndex);

            switch (columnIndex) {
                case 1:
                    representation.setMediaType(value == null ? "" : value.toString());
                    break;
                case 2: {
                    if (value == null) {
                        value = "";
                    }

                    String[] items = value.toString().split(" ");
                    List<Integer> status = new ArrayList<Integer>();

                    for (String item : items) {
                        try {
                            if (StringUtils.hasContent(item)) {
                                status.add(Integer.parseInt(item.trim()));
                            }
                        } catch (NumberFormatException e) {
                        }
                    }

                    representation.setStatus(status);
                    break;
                }
            }
        }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.impl.rest.RestRepresentation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.