Class AWriteContext

  • All Implemented Interfaces:
    IContext
    Direct Known Subclasses:
    WriteContextDesktop

    public abstract class AWriteContext
    extends java.lang.Object
    implements IContext
    Context for writing an xml.
    • Field Detail

      • writer

        protected java.lang.Object writer
        The writer.
      • classloader

        protected java.lang.ClassLoader classloader
        The classloader.
      • rootobject

        protected java.lang.Object rootobject
        The root object.
      • usercontext

        protected java.lang.Object usercontext
        The user context.
      • writtenobs

        protected java.util.Map<java.lang.Object,​java.lang.Object> writtenobs
        The written objects.
      • stack

        protected java.util.List<StackElement> stack
        The stack.
      • id

        protected int id
        The id counter.
      • namespacebypackage

        protected java.util.Map<java.lang.String,​Namespace> namespacebypackage
        The namespaces.
      • nscnt

        protected int nscnt
    • Constructor Detail

      • AWriteContext

        public AWriteContext​(IObjectWriterHandler handler,
                             java.lang.Object writer,
                             java.lang.Object usercontext,
                             java.lang.Object rootobject,
                             java.lang.ClassLoader classloader)
        Create a new write context.
      • AWriteContext

        public AWriteContext​(IObjectWriterHandler handler,
                             java.lang.Object writer,
                             java.lang.Object usercontext,
                             java.lang.Object rootobject,
                             java.lang.ClassLoader classloader,
                             java.util.Map<java.lang.Object,​java.lang.Object> writtenobs,
                             java.util.List<StackElement> stack,
                             MultiCollection<java.lang.Integer,​IPreProcessor> preprocessors)
        Create a new write context.
    • Method Detail

      • setHandler

        public void setHandler​(IObjectWriterHandler handler)
        Set the handler.
        Parameters:
        handler - The handler to set.
      • getWriter

        public java.lang.Object getWriter()
        Get the writer.
        Returns:
        The writer.
      • setWriter

        public void setWriter​(java.lang.Object writer)
        Set the writer.
        Parameters:
        writer - The writer to set.
      • getRootObject

        public java.lang.Object getRootObject()
        Get the root object.
        Specified by:
        getRootObject in interface IContext
        Returns:
        The root object.
      • setRootObject

        public void setRootObject​(java.lang.Object root)
        Set the root object.
        Parameters:
        root - The rootobject to set.
      • getClassLoader

        public java.lang.ClassLoader getClassLoader()
        Get the classloader.
        Specified by:
        getClassLoader in interface IContext
        Returns:
        The classloader.
      • setClassLoader

        public void setClassLoader​(java.lang.ClassLoader classloader)
        Set the classloader.
        Parameters:
        classloader - The classloader to set.
      • getUserContext

        public java.lang.Object getUserContext()
        Get the callcontext.
        Specified by:
        getUserContext in interface IContext
        Returns:
        The callcontext.
      • setUserContext

        public void setUserContext​(java.lang.Object usercontext)
        Set the callcontext.
        Parameters:
        callcontext - The callcontext to set.
      • getWrittenObjects

        public java.util.Map<java.lang.Object,​java.lang.Object> getWrittenObjects()
        Get the writtenobs.
        Returns:
        The writtenobs.
      • setWrittenObjects

        public void setWrittenObjects​(java.util.Map<java.lang.Object,​java.lang.Object> writtenobs)
        Set the writtenobs.
        Parameters:
        writtenobs - The writtenobs to set.
      • getStack

        public java.util.List<StackElement> getStack()
        Get the stack.
        Returns:
        The stack.
      • setStack

        public void setStack​(java.util.List<StackElement> stack)
        Set the stack.
        Parameters:
        stack - The stack to set.
      • getPreProcessors

        public MultiCollection<java.lang.Integer,​IPreProcessor> getPreProcessors()
        Get the preprocessors.
        Returns:
        The preprocessors.
      • setPreProcessors

        public void setPreProcessors​(MultiCollection<java.lang.Integer,​IPreProcessor> preprocessors)
        Set the preprocessors.
        Parameters:
        preprocessors - The preprocessors to set.
      • getId

        public int getId()
        Get the id.
        Returns:
        the id.
      • setId

        public void setId​(int id)
        Set the id.
        Parameters:
        id - The id to set.
      • getNamespace

        public Namespace getNamespace​(java.lang.String uri)
        Get or create a namespace.
        Parameters:
        uri - The namespace uri.