com.fatdog.xmlEngine.junitTest
Class XYZ_ProtocolHandler

java.lang.Object
  extended bycom.fatdog.xmlEngine.junitTest.XYZ_ProtocolHandler
All Implemented Interfaces:
IProtocolHandler

public class XYZ_ProtocolHandler
extends java.lang.Object
implements IProtocolHandler

A test protocol handler that's used by the JUnit test suite ProtocolHandlerTest.

The handler recognizes custom addresses beginning with the scheme, "XYZ::". When XQEngine.setDocument(String) or the function doc(String) encounter an address prefixed by this scheme, the query engine will ask the protocol handler to provide the XML content corresponding to that address.

Version:
0.61
Author:
Howard Katz, howardk@fatdog.com

Constructor Summary
XYZ_ProtocolHandler()
           
 
Method Summary
 java.lang.String content(java.lang.String addr)
          Return the XML contents of the resource addressed by this custom protocol.
 void setContent(java.lang.String addr, java.lang.String content)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XYZ_ProtocolHandler

public XYZ_ProtocolHandler()
Method Detail

setContent

public void setContent(java.lang.String addr,
                       java.lang.String content)

content

public java.lang.String content(java.lang.String addr)
Description copied from interface: IProtocolHandler
Return the XML contents of the resource addressed by this custom protocol.

This callback method will be called when XQEngine determines that an address you've passed to XQEngine.setDocument(String) (or indirectly through the function fn:doc(String) is the address of a custom-protocol that you've previously registered with the query engine.

Specified by:
content in interface IProtocolHandler
Parameters:
addr - The address of the resource
Returns:
The serialized XML content of the resource at the address
See Also:
XQEngine.registerProtocolHandler(String, IProtocolHandler)