Saxon/C  0.3.1
Saxon Processor library for C/C++
 All Classes Functions Variables
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Friends | List of all members
SaxonProcessor Class Reference

#include <SaxonProcessor.h>

Public Member Functions

 SaxonProcessor ()
 A default constructor. More...
 
 SaxonProcessor (bool l)
 A constructor. More...
 
SaxonProcessoroperator= (const SaxonProcessor &other)
 
void createJVM ()
 
XsltProcessornewTransformer ()
 
XQueryProcessornewXQueryProcessor ()
 
XdmValueparseString (const char *source)
 
XdmValueparseFile (const char *source)
 
XdmValueparseURI (const char *source)
 
void setSourceValue (XdmValue *value)
 
void setSourceFile (const char *filename)
 
void setParameter (const char *name, XdmValue *value)
 
XdmValuegetParameter (const char *name)
 
map< string, XdmValue * > & getParameters ()
 
map< string, string > & getProperties ()
 
bool removeParameter (const char *name)
 
void setProperty (const char *name, const char *value)
 
const char * getProperty (const char *name)
 
void clearParameters ()
 
void clearProperties ()
 
int parameterSize ()
 
int propertiesSize ()
 
bool exceptionOccurred ()
 
SaxonApiExceptioncheckForException (JNIEnv *env, jclass callingClass, jobject callingObject)
 
void setcwd (const char *cwd)
 
void setResourcesDirectory (const char *dir)
 
const char * getResourcesDirectory ()
 
const char * version ()
 

Static Public Member Functions

static jclass lookForClass (JNIEnv *env, const char *name)
 Internal. More...
 
static jmethodID findConstructor (JNIEnv *env, jclass myClassInDll, string arguments)
 Internal. More...
 
static jobject createObject (JNIEnv *env, jclass myClassInDll, string arguments, bool l)
 Internal. More...
 
static jobject createObject2 (JNIEnv *env, jclass myClassInDll, string arguments, jobject obj, bool l)
 
static void close ()
 

Static Public Attributes

static int jvmCreated =0
 
static JNIEnv * env
 
static JavaVM * jvm
 

Protected Attributes

jclass versionClass
 
jclass procClass
 
jclass saxonCAPIClass
 
string cwd
 
string resources_dir
 
jobject proc
 
HANDLE myDllHandle
 
std::map< string, XdmValue * > parameters
 
std::map< string, string > properties
 
bool license
 
bool closed
 
SaxonApiExceptionexception
 

Friends

class XsltProcessor
 
class XQueryProcessor
 
class XdmValue
 

Detailed Description

An SaxonProcessor acts as a factory for generating XQuery, XPath, Schema and XSLT compilers In this alpha release only the XSLT compiler is available

Constructor & Destructor Documentation

SaxonProcessor::SaxonProcessor ( )

A default constructor.

Create Saxon Processor.

SaxonProcessor::SaxonProcessor ( bool  l)

A constructor.

Create Saxon Processor.

Parameters
l- Flag that a license is to be used. Default is false.

Member Function Documentation

SaxonApiException * SaxonProcessor::checkForException ( JNIEnv *  env,
jclass  callingClass,
jobject  callingObject 
)

Checks for pending exceptions and creates a SaxonApiException object, which handles one or more local exceptions objects

Parameters
env
callingClass
callingObject
Returns
SaxonApiException
void SaxonProcessor::clearParameters ( )

Clear parameter values set

void SaxonProcessor::clearProperties ( )

Clear property values set

void SaxonProcessor::close ( )
static

close method not currently used. Available in next release

jobject SaxonProcessor::createObject ( JNIEnv *  env,
jclass  myClassInDll,
string  arguments,
bool  l 
)
static

Internal.

interface to JNI methods to create a JNI Java class.

Parameters
env- JNI environment
myClassInDll- Class definition in library
arguments- Signature of the method
l- Presence of license file - not usage in Saxon/C-HE version
bool SaxonProcessor::exceptionOccurred ( )

Checks for pending exceptions without creating a local reference to the exception object

Returns
bool - true when there is a pending exception; otherwise return false
jmethodID SaxonProcessor::findConstructor ( JNIEnv *  env,
jclass  myClassInDll,
string  arguments 
)
static

Internal.

Interface to JNI methods to find the constructor for a Java class.

Parameters
env- JNI environment
myClassInDll- Class definition in library
arguments- Signature of the method
XdmValue * SaxonProcessor::getParameter ( const char *  name)

Get a parameter value by name

Parameters
name- Specified paramater name to get
Returns
XdmValue
map< string, XdmValue * > & SaxonProcessor::getParameters ( )

Get all parameters

map< string, string > & SaxonProcessor::getProperties ( )

Get all properties

const char * SaxonProcessor::getProperty ( const char *  name)

Get a property value by name

Parameters
name- Specified paramater name to get
Returns
string - Get string of the property as char pointer array
const char * SaxonProcessor::getResourcesDirectory ( )

get saxon resources directory

jclass SaxonProcessor::lookForClass ( JNIEnv *  env,
const char *  name 
)
static

Internal.

Interface to JNI methods to find a Java class in Saxon.

Parameters
env- JNI environment
name- Name of the class
int SaxonProcessor::parameterSize ( )
inline

Count of parameters in map

XdmValue * SaxonProcessor::parseFile ( const char *  source)

Parse a source document file and return it as an XdmValue.

XdmValue * SaxonProcessor::parseString ( const char *  source)

Parse a lexical representation of the source document and return it as an XdmValue

XdmValue * SaxonProcessor::parseURI ( const char *  source)

Parse a source document available by URI and return it as an XdmValue.

int SaxonProcessor::propertiesSize ( )
inline

Count of properties in map

bool SaxonProcessor::removeParameter ( const char *  name)

Remove a parameter (name, value) pair from a stylesheet

Parameters
namespaceicurrently not used
namethe name of the stylesheet parameter
Returns
bool - outcome of the romoval
void SaxonProcessor::setcwd ( const char *  cwd)

set the current working directory

void SaxonProcessor::setParameter ( const char *  name,
XdmValue value 
)

Set the value of a stylesheet parameter

Parameters
namethe name of the stylesheet parameter, as a string. For namespaced parameter use the JAXP solution i.e. "{uri}name"
valuethe value of the stylesheet parameter, or null to clear a previously set value
void SaxonProcessor::setProperty ( const char *  name,
const char *  value 
)

Set a property.

Parameters
nameof the property
valueof the property
void SaxonProcessor::setResourcesDirectory ( const char *  dir)

set saxon resources directory

void SaxonProcessor::setSourceFile ( const char *  filename)

Set the source from file i nthe Processor.

Parameters
filename= const char pointer array
void SaxonProcessor::setSourceValue ( XdmValue value)

Set the source document in the Processor.

Parameters
value- XdmValue
const char * SaxonProcessor::version ( )

Get the Saxon version

Returns
char array

Member Data Documentation

string SaxonProcessor::cwd
protected

current working directory

SaxonApiException* SaxonProcessor::exception
protected

Pointer to any potential exception thrown

bool SaxonProcessor::license
protected

indicates whether the Processor requires a Saxon that needs a license file (i.e. Saxon-EE) other a Saxon-HE Processor is created

std::map<string,XdmValue*> SaxonProcessor::parameters
protected

map of parameters used for the transformation as (string, value) pairs

jobject SaxonProcessor::proc
protected

Java Processor object

std::map<string,string> SaxonProcessor::properties
protected

map of properties used for the transformation as (string, string) pairs

string SaxonProcessor::resources_dir
protected

current Saxon resources directory


The documentation for this class was generated from the following files: