Java Code Examples for com.sun.xml.internal.bind.v2.runtime.MimeTypedTransducer

Following code examples demonstrate how to use com.sun.xml.internal.bind.v2.runtime.MimeTypedTransducerfrom java. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use com.sun.xml.internal.bind.v2.runtime.MimeTypedTransducerand various code implementation of this class.

    public static Transducer createTransducer(RuntimeNonElementRef ref) {
        Transducer t = ref.getTarget().getTransducer();
        RuntimePropertyInfo src = ref.getSource();
        ID id = src.id();

        if(id==ID.IDREF)
            return RuntimeBuiltinLeafInfoImpl.STRING;

        if(id==ID.ID)
            t = new IDTransducerImpl(t);

        MimeType emt = src.getExpectedMimeType();
        if(emt!=null)
            t = new MimeTypedTransducer(t,emt);

        if(src.inlineBinaryData())
            t = new InlineBinaryTransducer(t);

        if(src.getSchemaType()!=null) {
            if (src.getSchemaType().equals(createXSSimpleType())) {
                return RuntimeBuiltinLeafInfoImpl.STRING;
            }
            t = new SchemaTypeTransducer(t,src.getSchemaType());
        }

        return t;
    } 


Advertisement
Javadoc
Transducer decorator that wraps another Transducer and sets the expected MIME type to the context.



Combined with Transducer implementations (such as one for Image), this is used to control the marshalling of the BLOB types. @author Kohsuke Kawaguchi

Read More
Advertisement