Class XmlSerializer

java.lang.Object
org.reflections.serializers.XmlSerializer
All Implemented Interfaces:
Serializer

public class XmlSerializer extends Object implements Serializer
xml serialization for Reflections
reflections.save(file, new XmlSerializer())

an example of produced xml:

 <Reflections>
   <SubTypes>
     <entry>
       <key>org.reflections.TestModel$C1</key>
       <values>
         <value>org.reflections.TestModel$C2</value>
         <value>org.reflections.TestModel$C3</value>
       </values>
     </entry>
   </SubTypes>
   <TypesAnnotated>
     <entry>
       <key>org.reflections.TestModel$AC2</key>
       <values>
         <value>org.reflections.TestModel$C2</value>
         <value>org.reflections.TestModel$C3</value>
       </values>
     </entry>
   </TypesAnnotated>
 </Reflections>
 
  • Constructor Details

    • XmlSerializer

      public XmlSerializer()
  • Method Details

    • read

      public Reflections read(InputStream inputStream)
      Description copied from interface: Serializer
      reads the input stream into a new Reflections instance, populating it's store
      Specified by:
      read in interface Serializer
    • save

      public File save(Reflections reflections, String filename)
      Description copied from interface: Serializer
      saves a Reflections instance into the given filename
      Specified by:
      save in interface Serializer
    • createDocument

      private org.dom4j.Document createDocument(Store store)