Package org.jbpm.formapi.shared.form

Examples of org.jbpm.formapi.shared.form.FormRepresentationDecoder.decode()


       
       
        FormRepresentation form = decoder.decode(json);
        assertNotNull("form shouldn't be null", form);
        String json2 = encoder.encode(form);
        FormRepresentation form2 = decoder.decode(json2);
        assertNotNull("json2 shouldn't be null", json2);
        assertNotSame("json2 shouldn't be empty", "", json2);
       
        assertNotNull("form2 shouldn't be null", form2);
        assertEquals("both forms should be the same in contents", form, form2);
View Full Code Here


        if (mapElements != null) {
            for (List<Map<String, Object>> mapRow : mapElements) {
                List<FormItemRepresentation> row = new ArrayList<FormItemRepresentation>();
                if (mapRow != null) {
                    for (Map<String, Object> mapCell : mapRow) {
                        row.add((FormItemRepresentation) decoder.decode(mapCell));
                    }
                }
                this.elements.add(row);
            }
        }
View Full Code Here

        this.elements = new ArrayList<OptionRepresentation>();
        List<Map<String, Object>> elems = (List<Map<String, Object>>) data.get("elements");
        FormRepresentationDecoder decoder = FormEncodingFactory.getDecoder();
        if (elems != null) {
            for (Map<String, Object> map : elems) {
                this.elements.add((OptionRepresentation) decoder.decode(map));
            }
        }
        this.elementsPopulationScript = (FBScript) decoder.decode((Map<String, Object>) data.get("elementsPopulationScript"));
    }
   
View Full Code Here

        if (elems != null) {
            for (Map<String, Object> map : elems) {
                this.elements.add((OptionRepresentation) decoder.decode(map));
            }
        }
        this.elementsPopulationScript = (FBScript) decoder.decode((Map<String, Object>) data.get("elementsPopulationScript"));
    }
   
    @Override
    public boolean equals(Object obj) {
        if (!super.equals(obj)) return false;
View Full Code Here

        if (mapItems != null) {
            for (Map<String, Object> entry : mapItems) {
                int x = entry.get("x") == null ? 0 : ((Number) entry.get("x")).intValue();
                int y = entry.get("y") == null ? 0 : ((Number) entry.get("y")).intValue();
                Position pos = new Position(x, y);
                FormItemRepresentation item = (FormItemRepresentation) decoder.decode(entry);
                this.items.put(pos, item);
            }
        }
    }
   
View Full Code Here

        this.items.clear();
        FormRepresentationDecoder decoder = FormEncodingFactory.getDecoder();
        List<Map<String, Object>> mapItems = (List<Map<String, Object>>) data.get("items");
        if (mapItems != null) {
            for (Map<String, Object> mapItem : mapItems) {
                this.items.add((FormItemRepresentation) decoder.decode(mapItem));
            }
        }
    }
   
    @Override
View Full Code Here

    @SuppressWarnings("unchecked")
    public void setDataMap(Map<String, Object> data) throws FormEncodingException {
        super.setDataMap(data);
        this.condition = (String) data.get("condition");
        FormRepresentationDecoder decoder = FormEncodingFactory.getDecoder();
        this.ifBlock = (FormItemRepresentation) decoder.decode((Map<String, Object>) data.get("ifBlock"));
        this.elseBlock = (FormItemRepresentation) decoder.decode((Map<String, Object>) data.get("elseBlock"));
    }
   
    @Override
    public boolean equals(Object obj) {
View Full Code Here

    public void setDataMap(Map<String, Object> data) throws FormEncodingException {
        super.setDataMap(data);
        this.condition = (String) data.get("condition");
        FormRepresentationDecoder decoder = FormEncodingFactory.getDecoder();
        this.ifBlock = (FormItemRepresentation) decoder.decode((Map<String, Object>) data.get("ifBlock"));
        this.elseBlock = (FormItemRepresentation) decoder.decode((Map<String, Object>) data.get("elseBlock"));
    }
   
    @Override
    public boolean equals(Object obj) {
        if (!super.equals(obj)) return false;
View Full Code Here

        Map<String, String> props = service.getFormBuilderProperties();
        String langsProperty = props.get("form.builder.languages"); //"gwt,ftl"
        String[] langs = langsProperty.split(","); //{ "gwt", "ftl" }
        FormRepresentationDecoder decoder = FormEncodingFactory.getDecoder();
        String json = getFormTestJsonRepresentation();
        FormRepresentation form = decoder.decode(json);
        Set<Throwable> errors = new HashSet<Throwable>();
        for (String language : langs) {
            try {
                Translator translator = TranslatorFactory.getInstance().getTranslator(language);
                assertNotNull("translator shouldn't be null", translator);
View Full Code Here

        List<Object> mapItems = (List<Object>) data.get("items");
        FormRepresentationDecoder decoder = FormEncodingFactory.getDecoder();
        if (mapItems != null) {
            for (Object obj : mapItems) {
                Map<String, Object> itemMap = (Map<String, Object>) obj;
                FormItemRepresentation item = (FormItemRepresentation) decoder
                        .decode(itemMap);
                this.items.add(item);
            }
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.