Class IpsEnumToXmlWriter

java.lang.Object
org.faktorips.runtime.IpsEnumToXmlWriter

public class IpsEnumToXmlWriter extends Object
This class is used in generated code for enums to write their values to XML when the generator setting "Generate toXml Support" is activated.
  • Field Details

  • Constructor Details

    • IpsEnumToXmlWriter

      public IpsEnumToXmlWriter(IRuntimeRepository repository, Class<?> enumClass)
      To save an extensible enum to XML, all instances need to be loaded from the IRuntimeRepository therefore we require non-null parameters.
      Parameters:
      repository - the repository
      enumClass - the enum class
    • IpsEnumToXmlWriter

      public IpsEnumToXmlWriter(IRuntimeRepository repository, Class<?> enumClass, List<?> enumValues)
      To save an extensible enum to XML, all instances need to be loaded from the IRuntimeRepository therefore we require non-null parameters.
      Parameters:
      repository - the repository
      enumClass - the enum class
      enumValues - the value of the enum type as list
  • Method Details

    • toXml

      public Element toXml(Document document)
      Creates an XML Element that represents this enums data.
      Parameters:
      document - a document, that can be used to create XML elements.
      Throws:
      UnsupportedOperationException - if the support for toXml ("Generate toXml Support") is not activated in the Faktor-IPS standard builder.