Package com.cumulocity.me.rest.representation

Examples of com.cumulocity.me.rest.representation.AbstractExtensibleRepresentation


public abstract class BaseExtensibleResourceRepresentationConverter extends BaseResourceRepresentationConverter {

    protected void basePropertiesToJson(BaseResourceRepresentation representation, JSONObject json) {
        super.basePropertiesToJson(representation, json);
        AbstractExtensibleRepresentation r = (AbstractExtensibleRepresentation) representation;
        Map attrs = r.getAttrs();
        if (!attrs.isEmpty()) {
            Iterator i = attrs.entrySet().iterator();
            while (i.hasNext()) {
                Entry entry = (Entry) i.next();
                String propertyName = (String) entry.getKey();
View Full Code Here


    }
   
    protected void extraPropertiesFromJson(JSONObject json, BaseResourceRepresentation representation) {
        super.extraPropertiesFromJson(json, representation);
       
        AbstractExtensibleRepresentation r = (AbstractExtensibleRepresentation) representation;
       
        Enumeration en = json.keys();
        while (en.hasMoreElements()) {
            String propertyName = (String) en.nextElement();
            if (!wasParsed(propertyName)) {
                try {
                    Class propertyType = ExtensibilityConverter.classFromExtensibilityString(propertyName);
                    r.setProperty(propertyName, getObject(json, propertyName, propertyType));
                } catch (ClassNotFoundException e) {
                    r.setProperty(propertyName, getString(json, propertyName));
                }
            }
        }
       
        parseContext.pop();
View Full Code Here

TOP

Related Classes of com.cumulocity.me.rest.representation.AbstractExtensibleRepresentation

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.