0

I want to create a model which contains the property of type java.awt.image.BufferedImage, I tried to create it but getting error as follows

src-resolve: Cannot resolve the name 'java.awt.image.BufferedImage' to a(n) 'type definition' component.

My XSD code:=

<xsd:complexType name="MyFrame">
    <xsd:sequence>
        <xsd:element name="frameNo" type="xsd:int" minOccurs="1" />
        <xsd:element name="frame" type="xsd:base64Binary" minOccurs="1" />
        <xsd:element name="bufferedImage" type="java.awt.image.BufferedImage" minOccurs="1" /> //here is the error
    </xsd:sequence>
</xsd:complexType>
Sat
  • 3,520
  • 9
  • 39
  • 66
  • 1
    Please show the code or describe the steps you take to cause the error. An XSD file itself doesn't cause an error. – Sam Apr 25 '18 at 10:51
  • Of course you got that error. An XML schema type is not a Java type. Use `xsd:base64Binary` like the line above is using. To convert a BufferedImage to bytes, write it to an image format (like PNG), or obtain its Raster and write the DataBuffer (in which case you also need to save the SampleModel somehow). – VGR Apr 25 '18 at 11:51
  • You can also implement and configure `XmlJavaTypeAdapter` which would convert between `xsd:base64Binary` and `BufferedImage`. – lexicore Apr 26 '18 at 09:12

0 Answers0