Class JSONReplyDocument

java.lang.Object
com.iizix.prop.GProp<GProp<?>[]>
com.iizix.prop.PropCnr
com.iizix.ws.prop.json.JSONReplyDocument
All Implemented Interfaces:
EventListener, IGProp<GProp<?>[]>, IPropCnr, IReplyProcessor, Cloneable
Direct Known Subclasses:
EditorJSONReplyDocument

public class JSONReplyDocument extends PropCnr implements IReplyProcessor
The JSON reply document contains information that identifies the reply transaction and maps the structured data into VSFields and VSTables (or columns).
Author:
Christopher Mindus
  • Constructor Details

    • JSONReplyDocument

      public JSONReplyDocument()
      Creates the property container without a name.
    • JSONReplyDocument

      public JSONReplyDocument(Atom propertyAtom)
      Creates the property container.
      Parameters:
      propertyAtom - the name of the component, unique within it's parent.
  • Method Details

    • clone

      public JSONReplyDocument clone()
      Clones the instance.
      Overrides:
      clone in class PropCnr
      Returns:
      A cloned instance.
    • getDescription

      public String getDescription()
      Gets the description of this this processor, with a default text.
      Returns:
      A descriptive text.
    • shouldCreateProps

      protected boolean shouldCreateProps(Element element)
      Checks if a child Element should be created as properties or if it should be skipped. Override this method (and call super.shouldCreateProps(element)) if the container creates other child elements.
      Overrides:
      shouldCreateProps in class PropCnr
      Parameters:
      element - The element in question.
      Returns:
      true to create properties out of it, false to ignore the element.
    • getDocumentString

      protected String getDocumentString()
      Gets the JSON "Document" String.
      Returns:
      The JSON "Document" String when called in the Designer, null otherwise.
    • getDocument

      protected JSONObject getDocument()
      Gets the JSON "Document" Object. This method can only be used in the Designer.
      Returns:
      The JSON "Document" Object, null when not used in the Designer.
    • setDocument

      protected boolean setDocument(JSONObject doc)
      Sets the JSON Document from a Reply. This method can only be used in the Designer.
      Returns:
      true for changed document string, false for same contents or failure to save document.
    • getWebServiceProp

      public WebServiceProp getWebServiceProp()
      Gets the Web Service property.
      Returns:
      The Web Service property, or null if not attached to it.
    • getOutput

      public OutputProps getOutput()
      Gets the output properties.
      Returns:
      The output properties.
    • getVirtualSpace

      public VirtualSpace getVirtualSpace()
      Gets the VirtualSpace.
      Returns:
      The VirtualSpace connected the the variable input, or null for none.
    • getReplyMatch

      public String getReplyMatch(IReplyContent reply)
      Called to verify if the reply matches the reply format of this processor.
      Specified by:
      getReplyMatch in interface IReplyProcessor
      Parameters:
      reply - The reply contents.
      Returns:
      null for match, or an error message.
    • processReply

      public void processReply(IAppSessionGyro appGyro, OutputProps output, IReplyContent reply) throws PropException
      Processes the reply contents for the Web Service.
      Specified by:
      processReply in interface IReplyProcessor
      Parameters:
      appGyro - The application session gyro in the server, null for Designer.
      output - The output properties.
      reply - The reply contents.
      Throws:
      PropException - For property errors.
    • getFailureMessage

      public String getFailureMessage()
      Gets the failure message for the reply.
      Specified by:
      getFailureMessage in interface IReplyProcessor
      Returns:
      null to proceed processing, or a String as message to throw to abort the web service.
    • processReply

      protected boolean processReply(IAppSessionGyro appGyro, OutputProps output, JSONReply reply, boolean doPerform, IComplexOperation op, List<VSComponent> list, Map<VSComponent,Throwable> errors) throws PropException
      Processes the reply to populate VirtualSpace.
      Parameters:
      appGyro - The application session gyro in the server, null for Designer.
      output - The output properties.
      reply - The JSON reply.
      doPerform - Flag to perform the operation, or just for testing.
      op - The Complex Operation, or null for none.
      list - List filled with propagated items, null for none.
      errors - Map filled with errors, null for none.
      Throws:
      PropException - For property errors.