Package com.coherentlogic.wb.client.core.converters

Source Code of com.coherentlogic.wb.client.core.converters.SourceConverter

package com.coherentlogic.wb.client.core.converters;

import static com.coherentlogic.wb.client.core.domain.Constants.ID;

import com.coherentlogic.wb.client.core.domain.Source;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;

/**
* A converter that converts wb:source elements into instances of
* {@link Source}.
*
* @author <a href="mailto:support@coherentlogic.com">Support</a>
*/
public class SourceConverter extends IdValuePairConverter {

    public SourceConverter() {
        super(Source.class);
    }

    @Override
    public Object unmarshal(
        HierarchicalStreamReader reader,
        UnmarshallingContext context
    ) {
        Source source = new Source ();

        String id = reader.getAttribute(ID);

        source.setId(id);

        String value = reader.getValue();

        source.setValue(value);

        return source;
    }
}
TOP

Related Classes of com.coherentlogic.wb.client.core.converters.SourceConverter

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.