com.ibm.as400.data

Class ProgramCallDocument

  • All Implemented Interfaces:
    Serializable, Cloneable


    public class ProgramCallDocument
    extends Object
    implements Serializable, Cloneable
    XML Document based program call. The ProgramCallDocument class uses a Program Call Markup Language (PCML) document to call IBM i system programs. PCML is an XML language for describing the input and output parameters to the IBM i system program. This class parses a PCML document and allows the application to call IBM i system programs described in the PCML document.

    Command Line Interface

    The command line interface may be used to serialize PCML document definitions. Note that XPCML documents cannot be serialized.
     java com.ibm.as400.data.ProgramCallDocument
         -serialize
         PCML document name
     
    Options:
    -serialize
    Parses the PCML document and creates a serialized version of the document. The name of the serialized file will match the document name, and the file extension will be .pcml.ser (lowercase).

    PCML document name
    The fully-qualified resource name of the PCML document which defines the program interface.
    See Also:
    Serialized Form
    • Constructor Detail

      • ProgramCallDocument

        public ProgramCallDocument(AS400 sys,
                           String docName)
                            throws PcmlException
        Constructs a ProgramCallDocument object. The PCML or XPCML document resource will be loaded from the classpath. If the document is a PCML document, the classpath will first be searched for a serialized resource. XPCML documents cannot be serialized. If a serialized resource is not found, the classpath will be searched for a PCML or XPCML source file.
        Parameters:
        sys - The system on which to run the program.
        docName - The document resource name of the PCML document for the programs to be called. All PCML-related file extensions are assumed to be lowercase (for example, .pcml or .pcml.ser). The resource name can be a package qualified name. For example, "com.myCompany.myPackage.myPcml"
        Throws:
        PcmlException - when the specified PCML document cannot be found
      • ProgramCallDocument

        public ProgramCallDocument(AS400 sys,
                           String docName,
                           InputStream xsdStream)
                            throws PcmlException
        Constructs a ProgramCallDocument object. The XPCML document resource will be loaded from the classpath and parsed using the XML schema definitions provided in the input XSD stream.
        Parameters:
        sys - The system on which to run the program.
        docName - The document resource name of the PCML document for the programs to be called. All PCML-related file extensions are assumed to be lowercase (for example, .pcml or .pcml.ser).
        xsdStream - An input stream that contains XML schema definitions that extend XPCML. The resource name can be a package qualified name. For example, "com.myCompany.myPackage.myPcml"
        Throws:
        PcmlException - when the specified PCML document cannot be found
      • ProgramCallDocument

        public ProgramCallDocument(AS400 sys,
                           String docName,
                           ClassLoader loader)
                            throws PcmlException
        Constructs a ProgramCallDocument object. The PCML or XPCML document resource will be loaded from the classpath. If the document is a PCML document, the classpath will first be searched for a serialized resource. XPCML documents cannot be serialized. If a serialized resource is not found, the classpath will be searched for a PCML or XPCML source file.
        Parameters:
        sys - The system on which to run the program.
        docName - The document resource name of the PCML document for the programs to be called. All PCML-related file extensions are assumed to be lowercase (for example, .pcml or .pcml.ser). The resource name can be a package qualified name. For example, "com.myCompany.myPackage.myPcml"
        loader - The ClassLoader that will be used when loading the specified document resource.
        Throws:
        PcmlException - when the specified PCML document cannot be found
      • ProgramCallDocument

        public ProgramCallDocument(AS400 sys,
                           String docName,
                           ClassLoader loader,
                           InputStream xsdStream)
                            throws PcmlException
        Constructs a ProgramCallDocument object. The PCML or XPCML document resource will be loaded from the classpath and parsed using the XML schema definitions provided in the input XSD stream.
        Parameters:
        sys - The system on which to run the program.
        docName - The document resource name of the PCML document for the programs to be called. All PCML-related file extensions are assumed to be lowercase (for example, .pcml or .pcml.ser).
        loader - The ClassLoader that will be used when loading the specified document resource.
        xsdStream - An input stream that contains XML schema definitions that extend XPCML. This parameter can be null. The resource name can be a package qualified name. For example, "com.myCompany.myPackage.myPcml"
        Throws:
        PcmlException - when the specified PCML document cannot be found
      • ProgramCallDocument

        public ProgramCallDocument(AS400 sys,
                           String docName,
                           InputStream docStream,
                           ClassLoader loader,
                           InputStream xsdStream,
                           int type)
                            throws PcmlException
        Constructs a ProgramCallDocument object. The PCML or XPCML document resource will be read from the specified input stream, and parsed using the XML schema definitions provided in the input XSD stream.
        Parameters:
        sys - The system on which to run the program.
        docName - The document resource name of the PCML document for the programs to be called. All PCML-related file extensions are assumed to be lowercase (for example, .pcml or .pcml.ser).
        docStream - The InputStream from which to read the contents of the document.
        loader - The ClassLoader that will be used when loading the DTD for PCML. This parameter can be null.
        xsdStream - An input stream that contains XML schema definitions that extend XPCML The resource name can be a package qualified name. For example, "com.myCompany.myPackage.myPcml". This parameter can be null.
        type - The type of data contained in docStream. Possible values are:
        • SERIALIZED - The docStream contains a serialized PCML or XPCML document.
        • SOURCE_PCML - The docStream contains a PCML document.
        • SOURCE_XPCML - The docStream contains an XPCML document.
        Throws:
        PcmlException - when the specified PCML document cannot be found
      • ProgramCallDocument

        public ProgramCallDocument()
                            throws PcmlException
        Constructs a ProgramCallDocument object. setSystem() and setDocument() must be called prior to using the object.
        Throws:
        PcmlException - when the specified PCML document cannot be found
      • ProgramCallDocument

        public ProgramCallDocument(String docName)
                            throws PcmlException
        Constructs a ProgramCallDocument object. setSystem() must be called prior to using the object. The PCML or XPCML document resource will be loaded from the classpath. If the document is a PCML document, the classpath will first be searched for a serialized resource. XPCML documents cannot be serialized. If a serialized resource is not found, the classpath will be searched for a PCML or XPCML source file.
        Parameters:
        docName - The document resource name of the PCML document for the programs to be called. All PCML-related file extensions are assumed to be lowercase (for example, .pcml or .pcml.ser). The resource name can be a package qualified name. For example, "com.myCompany.myPackage.myPcml"
        Throws:
        PcmlException - when the specified PCML document cannot be found
      • ProgramCallDocument

        public ProgramCallDocument(String docName,
                           ClassLoader loader)
                            throws XmlException
        Constructs a ProgramCallDocument object. setSystem() must be called prior to using the object. The PCML or XPCML document resource will be loaded from the classpath of the specified ClassLoader. If the document is a PCML document, the classpath will first be searched for a serialized resource. XPCML documents cannot be serialized. If a serialized resource is not found, the classpath will be searched for a PCML or XPCML source file.
        Parameters:
        docName - The document resource name of the PCML document for the programs to be called.
        loader - The ClassLoader that will be used when loading the specified document resource.
        Throws:
        PcmlException - when the specified PCML document cannot be found
        XmlException
    • Method Detail

      • main

        public static void main(String[] args)
        Provides a command line interface to ProgramCallDocument. See the class description. Note that XPCML documents cannot be serialized.
      • callProgram

        public boolean callProgram(String name)
                            throws PcmlException
        Calls the named program.
        Parameters:
        name - The name of the <program> element in the PCML document.
        Throws:
        PcmlException - If an error occurs.
      • getErrno

        public int getErrno(String name)
                     throws PcmlException
        Returns an "errno" value for the named service program element.

        The named program element must be defined as a service program entrypoint. The value returned is the "errno" value resulting from the most recent call to the program. If the program has not been called, zero is returned.

        Parameters:
        name - The name of the <program> element in the PCML document.
        Returns:
        The integer "errno" value for the named service program element.
        Throws:
        PcmlException - If an error occurs.
      • getDescriptor

        public static Descriptor getDescriptor(String docName)
                                        throws PcmlException
        Returns a Descriptor for the specified PCML document. The PCML document resource will be loaded from the classpath. The classpath will first be searched for a serialized resource. If a serialized resource is not found, the classpath will be searched for a PCML source file.
        Parameters:
        docName - The document resource name of the PCML document for which the Descriptor is returned. The resource name can be a package qualified name. For example, "com.myCompany.myPackage.myPcml"
        Returns:
        The Descriptor for the <pcml> element of the named PCML file.
        Throws:
        PcmlException - when the specified PCML document cannot be found
      • getDescriptor

        public static Descriptor getDescriptor(String docName,
                               InputStream xsdStream)
                                        throws PcmlException
        Returns a Descriptor for the specified XPCML document. The XPCML document resource will be loaded from the classpath.
        Parameters:
        docName - The document resource name of the XPCML document for which the Descriptor is returned. The resource name can be a package qualified name. For example, "com.myCompany.myPackage.myPcml"
        xsdStream - An input stream that contains XML schema definitions that extend XPCML
        Returns:
        The Descriptor for the <pcml> element of the named PCML file.
        Throws:
        PcmlException - when the specified PCML document cannot be found
      • getDescriptor

        public static Descriptor getDescriptor(String docName,
                               ClassLoader loader)
                                        throws PcmlException
        Returns a Descriptor for the specified PCML document. The PCML document resource will be loaded from the classpath. The classpath will first be searched for a serialized resource. If a serialized resource is not found, the classpath will be searched for a PCML source file.
        Parameters:
        docName - The document resource name of the PCML document for which the Descriptor is returned. The resource name can be a package qualified name. For example, "com.myCompany.myPackage.myPcml"
        loader - The ClassLoader that will be used when loading the specified document resource.
        Returns:
        The Descriptor for the <pcml> element of the named PCML file.
        Throws:
        PcmlException - when the specified PCML document cannot be found
      • getDescriptor

        public static Descriptor getDescriptor(String docName,
                               ClassLoader loader,
                               InputStream xsdStream)
                                        throws PcmlException
        Returns a Descriptor for the specified XPCML document. The XPCML document resource will be loaded from the classpath.
        Parameters:
        docName - The document resource name of the PCML document for which the Descriptor is returned. The resource name can be a package qualified name. For example, "com.myCompany.myPackage.myPcml"
        loader - The ClassLoader that will be used when loading the specified document resource.
        xsdStream - An input stream that contains XML schema definitions that extend XPCML.
        Returns:
        The Descriptor for the <pcml> element of the named PCML file.
        Throws:
        PcmlException - when the specified PCML document cannot be found
      • getDescriptor

        public Descriptor getDescriptor()
        Returns a Descriptor for the current PCML document.
        Returns:
        The Descriptor for the <pcml> element of the current PCML file or null if the PCML document has not be set.
      • getIntReturnValue

        public int getIntReturnValue(String name)
                              throws PcmlException
        Returns an int return value for the named service program element.

        The named program element must be defined as a service program entrypoint. The value returned is the integer return value from the most recent call to the program. If the program has not been called, zero is returned.

        Parameters:
        name - The name of the <program> element in the PCML document.
        Returns:
        The integer return value for the named service program element.
        Throws:
        PcmlException - If an error occurs.
      • getIntValue

        public int getIntValue(String name)
                        throws PcmlException
        Returns an int value for the named element.

        If the named element is String or a Number output value of a program, the value will be converted to an int.

        Parameters:
        name - The name of the <data> element in the PCML document.
        Returns:
        The integer value for the named element.
        Throws:
        PcmlException - If an error occurs.
      • getIntValue

        public int getIntValue(String name,
                      int[] indices)
                        throws PcmlException
        Returns an int value for the named element given indices to the data element. If the data element is an array or is an element in a structure array, an index must be specified for each dimension of the data.

        If the named element is String or a Number output value of a program, the value will be converted to an int.

        Parameters:
        name - The name of the <data> element in the PCML document.
        Returns:
        The integer value for the named element.
        Throws:
        PcmlException - If an error occurs.
      • getProgramCall

        public ProgramCall getProgramCall()
        Returns the ProgramCall object that was used in the most recent invocation of callProgram().
        Returns:
        The ProgramCall object; null if callProgram() has not been called.
      • getStringValue

        public String getStringValue(String name)
                              throws PcmlException
        Returns a String value for the named element.

        If the named element is String or a Number output value of a program, the value will be converted to a String. The default bidi string type is assumed (BidiStringType.DEFAULT).

        Parameters:
        name - The name of the <data> element in the PCML document.
        Throws:
        PcmlException - If an error occurs.
      • getStringValue

        public String getStringValue(String name,
                            int type)
                              throws PcmlException
        Returns a String value for the named element.

        This method is used when the string type cannot be determined until run-time. In those cases, the PCML document cannot be used to indicate the string type so this method is used to get the value using the string type that is specified.

        If the named element is String or a Number output value of a program, the value will be converted to a String.

        Parameters:
        name - The name of the <data> element in the PCML document.
        type - The bidi string type, as defined by the CDRA (Character Data Representation Architecture).
        Throws:
        PcmlException - If an error occurs.
        See Also:
        BidiStringType
      • getStringValue

        public String getStringValue(String name,
                            int[] indices)
                              throws PcmlException
        Returns a String value for the named element given indices to the data element. If the data element is an array or is an element in a structure array, an index must be specified for each dimension of the data. The default bidi string type is assumed (BidiStringType.DEFAULT).

        If the named element is String or a Number output value of a program, the value will be converted to a String.

        Parameters:
        name - The name of the <data> element in the PCML document.
        indices - An array of indices for setting the value of an element in an array.
        Throws:
        PcmlException - If an error occurs.
      • getStringValue

        public String getStringValue(String name,
                            int[] indices,
                            int type)
                              throws PcmlException
        Returns a String value for the named element given indices to the data element. If the data element is an array or is an element in a structure array, an index must be specified for each dimension of the data.

        This method is used when the string type cannot be determined until run-time. In those cases, the PCML document cannot be used to indicate the string type so this method is used to get the value using the string type that is specified.

        If the named element is String or a Number output value of a program, the value will be converted to a String.

        Parameters:
        name - The name of the <data> element in the PCML document.
        indices - An array of indices for setting the value of an element in an array.
        type - The bidi string type, as defined by the CDRA (Character Data Representation Architecture).
        Throws:
        PcmlException - If an error occurs.
        See Also:
        BidiStringType
      • getMessageList

        public AS400Message[] getMessageList(String name)
                                      throws PcmlException
        Returns the list of IBM i system messages returned from running the program. An empty list is returned if the program has not been run yet.
        Parameters:
        name - The name of the <program> element in the PCML document.
        Returns:
        The array of messages returned by the system for the program.
        Throws:
        PcmlException - If an error occurs.
      • getOutputsize

        public int getOutputsize(String name)
                          throws PcmlException
        Returns the number of bytes reserved for output for the named element.
        Parameters:
        name - The name of the <data> or <struct> element in the PCML document.
        Returns:
        The number of bytes reserved for output for the named element.
        Throws:
        PcmlException - If an error occurs.
      • getOutputsize

        public int getOutputsize(String name,
                        int[] indices)
                          throws PcmlException
        Returns the number of bytes reserved for output for the named element and indices.
        Parameters:
        name - The name of the <data> or <struct> element in the PCML document.
        indices - An array of indices for accessing the output size of an element in an array.
        Returns:
        The number of bytes reserved for output for the named element.
        Throws:
        PcmlException - If an error occurs.
      • getValue

        public Object getValue(String name)
                        throws PcmlException
        Returns the Java object value for the named element.

        If the named element is an output value of a program, the value will be converted from IBM i system data to a Java Object.

        The type of object returned depends on the description in the PCML document.

        PCML DescriptionObject Returned
        type=charString
        type=bytebyte[]
        type=int
        length=2
        precision=15
        Short
        type=int
        length=2
        precision=16
        Integer
        type=int
        length=4
        precision=31
        Integer
        type=int
        length=4
        precision=32
        Long
        type=int
        length=8
        precision=63
        Long
        type=int
        length=8
        precision=64
        BigInteger
        type=packedBigDecimal
        type=zonedBigDecimal
        type=float
        length=4
        Float
        type=float
        length=8
        Double
        type=datejava.sql.Date
        type=timejava.sql.Time
        type=timestampjava.sql.Timestamp
        Parameters:
        name - The name of the <data> element in the PCML document.
        Returns:
        The Java object value for the named <data> element in the PCML document.
        Throws:
        PcmlException - If an error occurs.
      • getValue

        public Object getValue(String name,
                      int[] indices)
                        throws PcmlException
        Returns the Java object value for the named element given indices to the data element. If the data element is an array or is an element in a structure array, an index must be specified for each dimension of the data.

        If the named element is an output value of a program, the value will be converted from IBM i system data to a Java Object.

        The type of object returned depends on the description in the PCML document.

        PCML DescriptionObject Returned
        type=charString
        type=bytebyte[]
        type=int
        length=2
        precision=15
        Short
        type=int
        length=2
        precision=16
        Integer
        type=int
        length=4
        precision=31
        Integer
        type=int
        length=4
        precision=32
        Long
        type=int
        length=8
        precision=63
        Long
        type=int
        length=8
        precision=64
        BigInteger
        type=packedBigDecimal
        type=zonedBigDecimal
        type=float
        length=4
        Float
        type=float
        length=8
        Double
        type=datejava.sql.Date
        type=timejava.sql.Time
        type=timestampjava.sql.Timestamp
        Parameters:
        name - The name of the <data> element in the PCML document.
        indices - An array of indices for accessing the value of an element in an array.
        Returns:
        The Java object value for the named <data> element in the PCML document.
        Throws:
        PcmlException - If an error occurs.
      • serialize

        public void serialize()
                       throws PcmlException
        Deprecated. Use serialize(File) instead.
        Serializes the ProgramCallDocument. Note that XPCML documents cannot be serialized. The filename of the serialized file will be of the form
             docName.pcml.ser
             
        where docName.pcml.ser (lowercase) is the name of the document used to construct this object.
        Throws:
        PcmlException - If an error occurs.
      • serialize

        public void serialize(OutputStream outputStream)
                       throws IOException,
                              PcmlException
        Serializes the ProgramCallDocument to a stream.
        Parameters:
        outputStream - The output stream to which to serialize the object.
        Throws:
        IOException - If an error occurs while writing to the stream.
        PcmlException - If an error occurs while processing PCML.
      • serialize

        public void serialize(File file)
                       throws IOException,
                              XmlException
        Serializes the ProgramCallDocument to a file.
        Parameters:
        file - The file to which to serialize the object.
        Throws:
        IOException - If an error occurs while writing to the file.
        XmlException - If an error occurs while processing RFML.
      • setIntValue

        public void setIntValue(String name,
                       int value)
                         throws PcmlException
        Sets the Java object value for the named element using a int input.

        The named element must be able to be set using a Integer object.

        Parameters:
        name - The name of the <data> element in the PCML document.
        value - The int value for the named element.
        Throws:
        PcmlException - If an error occurs.
      • setIntValue

        public void setIntValue(String name,
                       int[] indices,
                       int value)
                         throws PcmlException
        Sets the Java object value for the named element using an int input value given indices to the data element.

        The named element must be able to be set using a Integer object.

        Parameters:
        name - The name of the <data> element in the PCML document.
        indices - An array of indices for setting the value of an element in an array.
        value - The int value for the named element.
        Throws:
        PcmlException - If an error occurs.
      • setStringValue

        public void setStringValue(String name,
                          String value)
                            throws PcmlException
        Sets the Java object value for the named element using a String input. The default bidi string type is assumed (BidiStringType.DEFAULT).
        Parameters:
        name - The name of the <data> element in the PCML document.
        value - The string value for the named element.
        Throws:
        PcmlException - If an error occurs.
      • setStringValue

        public void setStringValue(String name,
                          String value,
                          int type)
                            throws PcmlException
        Sets the Java object value for the named element using a String input.

        This method is used when the string type cannot be determined until run-time. In those cases, the PCML document cannot be used to indicate the string type so this method is used to set the value and the string type of the input value.

        Parameters:
        name - The name of the <data> element in the PCML document.
        value - The string value for the named element.
        type - The bidi string type, as defined by the CDRA (Character Data Representation Architecture).
        Throws:
        PcmlException - If an error occurs.
        See Also:
        BidiStringType
      • setStringValue

        public void setStringValue(String name,
                          int[] indices,
                          String value,
                          int type)
                            throws PcmlException
        Sets the Java object value for the named element using a String input value given indices to the data element.

        This method is used when the string type cannot be determined until run-time. In those cases, the PCML document cannot be used to indicate the string type so this method is used to set the value and the string type of the input value.

        Parameters:
        name - The name of the <data> element in the PCML document.
        indices - An array of indices for setting the value of an element in an array.
        value - The string value for the named element.
        type - The bidi string type, as defined by the CDRA (Character Data Representation Architecture).
        Throws:
        PcmlException - If an error occurs.
        See Also:
        BidiStringType
      • setDocument

        public void setDocument(String docName)
                         throws PcmlException
        Sets the PCML or XPCML document resource. The PCML or XPCML document resource will be loaded from the classpath. The classpath will first be searched for a serialized resource. If a serialized resource is not found, the classpath will be searched for a PCML or XPCML source file.
        Parameters:
        docName - The document resource name of the PCML document for the programs to be called. The resource name can be a package qualified name. For example, "com.myCompany.myPackage.myPcml"
        Throws:
        PcmlException - when the specified PCML document cannot be found
      • setDocument

        public void setDocument(String docName,
                       InputStream xsdStream)
                         throws PcmlException
        Sets the XPCML document resource. The XPCML document resource will be loaded from the classpath.
        Parameters:
        docName - The document resource name of the PCML document for the programs to be called. The resource name can be a package qualified name. For example, "com.myCompany.myPackage.myPcml"
        xsdStream - An input stream that contains XML schema definitions that extend XPCML
        Throws:
        PcmlException - when the specified PCML document cannot be found
      • setDocument

        public void setDocument(String docName,
                       ClassLoader loader)
                         throws PcmlException
        Sets the PCML or XPCML document resource. The PCML or XPCML document resource will be loaded from the classpath. The classpath will first be searched for a serialized resource. If a serialized resource is not found, the classpath will be searched for a PCML or XPCML source file.
        Parameters:
        docName - The document resource name of the PCML document for the programs to be called. The resource name can be a package qualified name. For example, "com.myCompany.myPackage.myPcml"
        loader - The ClassLoader that will be used when loading the specified document resource.
        Throws:
        PcmlException - when the specified PCML document cannot be found
      • setDocument

        public void setDocument(String docName,
                       ClassLoader loader,
                       InputStream xsdStream)
                         throws PcmlException
        Sets the PCML or XPCML document resource. The document resource will be loaded from the classpath.
        Parameters:
        docName - The document resource name of the PCML or XPCML document for the programs to be called. The resource name can be a package qualified name. For example, "com.myCompany.myPackage.myPcml"
        loader - The ClassLoader that will be used when loading the specified document resource.
        xsdStream - An input stream that contains XML schema definitions that extend XPCML
        Throws:
        PcmlException - when the specified PCML document cannot be found
      • setSystem

        public void setSystem(AS400 system)
        Sets the system on which to call programs.
        Parameters:
        system - The system on which to call programs.
      • setValue

        public void setValue(String name,
                    Object value)
                      throws PcmlException
        Sets the Java object value for the named element.

        If the input value provided is not an instance of the correct Java class for the defined data type, it will be converted to the correct Java class. For example, an element defined as "type=int length=2 precision=15", will be converted to a Java Short object. In this case the value specified must be an instance of Number or String.

        If the named element is an input value to a program, the value will be converted to IBM i system data when callProgram() is called.

        Parameters:
        name - The name of the <data> element in the PCML document.
        value - The java object value for the named element. The type of Object passed must be the correct type for the element definition or a String that can be converted to the correct type.
        Throws:
        PcmlException - If an error occurs.
      • setValue

        public void setValue(String name,
                    int[] indices,
                    Object value)
                      throws PcmlException
        Sets the Java object value for the named element given indices to the data element. If the data element is an array or is an element in a structure array, an index must be specified for each dimension of the data.

        If the input value provided is not an instance of the correct Java class for the defined data type, it will be converted to the correct Java class. For example, an element defined as "type=int length=2 precision=15", will be converted to a Java Short object. In this case the value specified must be an instance of Number or String.

        If the named element is an input value to a program, the value will be converted to IBM i system data when callProgram() is called.

        Parameters:
        name - The name of the <data> element in the PCML document.
        indices - An array of indices for setting the value of an element in an array.
        value - The java object value for the named element. The type of Object passed must be the correct type for the element definition or a String that can be converted to the correct type.
        Throws:
        PcmlException - If an error occurs.
      • setThreadsafeOverride

        public void setThreadsafeOverride(String program,
                                 boolean threadsafe)
                                   throws PcmlException
        Allows the overriding of the threadsafe attribute of a program element.
        Parameters:
        program - The name of the <program> element in the PCML document.
        threadsafe - A boolean indicating whether the named program element should be considered thread safe (true) or not (false).
        Throws:
        PcmlException - If an error occurs.
      • getThreadsafeOverride

        public boolean getThreadsafeOverride(String program)
                                      throws PcmlException
        Gets the value of the override of the threadsafe attribute of a program element.
        Parameters:
        program - The name of the <program> element in the PCML document.
        Throws:
        PcmlException - If an error occurs.
      • generateXPCML

        public void generateXPCML(String pgmName,
                         OutputStream outputStream)
                           throws IOException,
                                  XmlException
        Generates XPCML representing the data associated with the passed-in program name. Note: XPCML cannot be generated from a serialized PCML file. XPCML is XML based on the XML schema defined in xpcml.xsd. XPCML is similar to PCML but allows for better validation of parameters and allows parameter data to be input and output within an XML document. PCML is data-less in that only parameter formats are input via PCML. In PCML, data values are set using the setValue methods of the ProgramCallDocument class, and data values are gotten using the getValue methods of ProgramCallDocument. In XPCML, data values can be specified directly within the XPCML source document, and data values can be output as XML using the generateXPCML method. Throws an XmlException if this object contains no data.
        Parameters:
        pgmName - The program to generate XPCML for
        outputStream - The output stream to which to write the text.
        Throws:
        IOException - If an error occurs while writing the data.
        XmlException - If an error occurs while processing XPCML.
      • generateXPCML

        public void generateXPCML(OutputStream outputStream)
                           throws IOException,
                                  XmlException
        Generates XPCML representing the data contained in the entire PCML node tree. Note: XPCML cannot be generated from a serialized PCML file. XPCML is XML based on the XML schema defined in xpcml.xsd. XPCML is similar to PCML but allows for better validation of parameters and allows parameter data to be input and output within an XML document. PCML is data-less in that only parameter formats are input via PCML. In PCML, data values are set using the setValue methods of the ProgramCallDocument class and data values are gotten using the getValue methods of ProgramCallDocument. In XPCML, data values can be specified directly within the XPCML document, and data values can be output as XML using the generateXPCML method. Throws an XmlException if this object contains no data.
        Parameters:
        outputStream - The output stream to which to write the text.
        Throws:
        IOException - If an error occurs while writing the data.
        XmlException - If an error occurs while processing XPCML.
      • generateXPCML

        public void generateXPCML(String fileName)
                           throws IOException,
                                  XmlException
        Generates XPCML representing the data contained in the entire PCML node tree. Note: XPCML cannot be generated from a serialized PCML file. XPCML is XML based on the XML schema defined in xpcml.xsd. XPCML is similar to PCML but allows for better validation of parameters and allows parameter data to be input and output within an XML document. PCML is data-less in that only parameter formats are input via PCML. In PCML, data values are set using the setValue methods of the ProgramCallDocument class and data values are gotten using the getValue methods of ProgramCallDocument. In XPCML, data values can be specified directly within the XPCML document, and data values can be output as XML using the generateXPCML method. Throws an XmlException if this object contains no data.
        Parameters:
        fileName - The pathname of the file to which to write the text.
        Throws:
        IOException - If an error occurs while writing the data.
        XmlException - If an error occurs while processing XPCML.
      • generateXPCML

        public void generateXPCML(String pgmName,
                         String fileName)
                           throws IOException,
                                  XmlException
        Generates XPCML representing the data contained for the passed in program name. Note: XPCML cannot be generated from a serialized PCML file. XPCML is XML based on the XML schema defined in xpcml.xsd. XPCML is similar to PCML but allows for better validation of parameters and allows parameter data to be input and output within an XML document. PCML is data-less in that only parameter formats are input via PCML. In PCML, data values are set using the setValue methods of the ProgramCallDocument class and data values are gotten using the getValue methods of ProgramCallDocument. In XPCML, data values can be specified directly within the XPCML document, and data values can be output as XML using the generateXPCML method. Throws an XmlException if this object contains no data.
        Parameters:
        pgmName - The program name to generate XPCML for.
        fileName - The pathname of the file to which to write the text.
        Throws:
        IOException - If an error occurs while writing the data.
        XmlException - If an error occurs while processing XPCML.
      • setXsdName

        public void setXsdName(String xsdName)
        Sets the XSD name that will appear in the generated <xpcml> tag from the generateXPCML() methods. If name is not set then "xpcml.xsd" will appear in <xpcml> tag. This allows the user to override the default and put in the name of their own xsd that was used in condensing the XPCML output.
        Parameters:
        xsdName - The XSD name to appear in the <xpcml> tag when XPCML is output using the generateXPCML method.
      • getXsdName

        public String getXsdName()
        Returns the value of the XSD name to be used on the <xpcml> tag when generating XPCML.
        Returns:
        The String "xsdName" value for this program object.
      • condenseXPCML

        public static void condenseXPCML(InputStream fullStream,
                         OutputStream xsdStream,
                         OutputStream condensedStream,
                         String xsdStreamName)
                                  throws IOException,
                                         PcmlException,
                                         TransformerException,
                                         SAXException
        Transforms a fully specified XPCML stream to a more condensed XPCML stream and an XSD stream representing the new type definitions created while condensing. Throws an XmlException if this object contains no data.
        Parameters:
        fullStream - The full XPCML input stream.
        xsdStream - The output xsd stream.
        condensedStream - The output condensed XPCML stream.
        xsdStreamName - The name of the xsd stream ("name.xsd") that will be created
        Throws:
        IOException - If an error occurs while writing the data.
        PcmlException - If an error occurs while processing XPCML.
        TransformerException
        SAXException