What is X in the above code ? (Choose one) Given that: What is X in the above code ? (Choose one) Given that: What is X in the above code ? (Choose one) A.byte[] B.DataHandler C.Image D.Byte[] Show Hint ← Previous question Next question →
Leo Yu why answer is not B) DataHandler schema: Java generated by JAXB @XmlRootElement public Class MyType{ @xmlElement @XmlAttachmentRef public DataHandler getDoc() } Reply
coco MIME Type Java Type image/gif java.awt.Image image/jpeg java.awt.Image text/plain java.lang.String text/xml or application/xml javax.xml.transform.Source example (is mapped to byte[]) (is mapped to java.awt.Image) C. is correct Reply
Mohamed Fayek Saber Required Mappings between MIME and Java Types : MIME Type Java Type DataHandler.getContentType() instanceof DataHandler.getContent() image/gif java.awt.Image image/jpeg java.awt.Image text/xml or application/xml javax.xml.transform.Source http://docs.oracle.com/javaee/6/api/javax/xml/bind/attachment/AttachmentUnmarshaller.html Reply
why answer is not B) DataHandler
schema:
Java generated by JAXB
@XmlRootElement
public Class MyType{
@xmlElement
@XmlAttachmentRef
public DataHandler getDoc()
}
MIME Type Java Type
image/gif java.awt.Image
image/jpeg java.awt.Image
text/plain java.lang.String
text/xml or application/xml javax.xml.transform.Source
example
(is mapped to byte[])
(is mapped to java.awt.Image)
C. is correct
Required Mappings between MIME and Java Types :
MIME Type Java Type
DataHandler.getContentType() instanceof DataHandler.getContent()
image/gif java.awt.Image
image/jpeg java.awt.Image
text/xml or application/xml javax.xml.transform.Source
http://docs.oracle.com/javaee/6/api/javax/xml/bind/attachment/AttachmentUnmarshaller.html