All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.codehaus.xfire.aegis.type.basic.URIType Maven / Gradle / Ivy

package org.codehaus.xfire.aegis.type.basic;

import java.net.URI;

import org.codehaus.xfire.MessageContext;
import org.codehaus.xfire.aegis.MessageReader;
import org.codehaus.xfire.aegis.MessageWriter;
import org.codehaus.xfire.aegis.type.Type;

/**
 * Type for a URI
 *
 * @author peter royal
 */
public class URIType extends Type
{
    public Object readObject( final MessageReader reader, final MessageContext context )
    {
        final String value = reader.getValue();

        return null == value ? null : URI.create( value );
    }

    public void writeObject( final Object object, final MessageWriter writer, final MessageContext context )
    {
        writer.writeValue( ((URI)object).toASCIIString() );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy