Class ElementEncoder


  • public class ElementEncoder
    extends Object
    Utility class to be used by bindings to encode an element or an attribute.
    Author:
    Justin Deoliveira, The Open Planning Project TODO: rename this class, it is not just for element.s
    • Constructor Summary

      Constructors 
      Constructor Description
      ElementEncoder​(BindingWalker bindingWalker, MutablePicoContainer context)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Attr encode​(Object value, XSDAttributeDeclaration attribute, Document document, XSDTypeDefinition container)  
      Element encode​(Object value, XSDElementDeclaration element, Document document)  
      Element encode​(Object value, XSDElementDeclaration element, Document document, XSDTypeDefinition container)
      Encodes a value corresponding to an element in a schema.
      void setContext​(MutablePicoContainer context)  
      void setLogger​(Logger logger)
      Sets the logger for the encoder to use.
      • Methods inherited from class Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ElementEncoder

        public ElementEncoder​(BindingWalker bindingWalker,
                              MutablePicoContainer context)
    • Method Detail

      • setLogger

        public void setLogger​(Logger logger)
        Sets the logger for the encoder to use.
      • encode

        public Element encode​(Object value,
                              XSDElementDeclaration element,
                              Document document)
      • encode

        public Element encode​(Object value,
                              XSDElementDeclaration element,
                              Document document,
                              XSDTypeDefinition container)
        Encodes a value corresponding to an element in a schema.
        Parameters:
        value - The value to encode.
        element - The declaration of the element corresponding to the value.
        document - The document used to create the encoded element.
        Returns:
        The encoded value as an element.
      • encode

        public Attr encode​(Object value,
                           XSDAttributeDeclaration attribute,
                           Document document,
                           XSDTypeDefinition container)
      • setContext

        public void setContext​(MutablePicoContainer context)