XDC - v. 0.6.1

net.sf.xdc.processing
Class XdcSource

java.lang.Object
  extended bynet.sf.xdc.processing.XdcSource
All Implemented Interfaces:
java.lang.Comparable

public class XdcSource
extends java.lang.Object
implements java.lang.Comparable

This class represents an XML source file which is to be processed by the XDC tool.

Since:
0.5
Version:
0.5
Author:
Jens Voß

Constructor Summary
XdcSource(java.io.File file, java.io.File sourceDir, java.lang.String packageName, DialectHandler handler)
          Public constructor.
 
Method Summary
 void addPattern(XPathPattern pattern)
          This method stores an XPathPattern (corresponding to a link with an XPath expression anchor) in this XdcSource.
static void clearProcessingProperties(java.util.Properties props)
          This method clears all file specific key-value pairs set in setProcessingProperties(Properties, String, String).
 int compareTo(java.lang.Object obj)
          This method compares this XdcSource with another one by
(1) their file names and
(2) the names of their respective packages.
 boolean equals(java.lang.Object o)
          This method determines whether this XdcSource is equal to another such object by comparing their respective File objects.
 DialectHandler getDialectHandler()
          Getter method for this XdcSource's DialectHandler object.
 java.io.File getFile()
          Getter method for this XdcSource's File object.
 java.lang.String getFileName()
          Getter method for this XdcSource's output file name.
 java.lang.String getPackageName()
          Getter method for this XdcSource's package name.
 java.util.Properties getPatterns()
          This method retrieves all XPathPattern objects stored in this XdcSource in the form of a Properties object (where the links in the source file make up the keys and the XPathPattern values make up the values).
 java.lang.String getRootComment()
          Getter method for this XdcSource's root comment String.
 java.io.File getSourceDir()
          Getter method for this XdcSource's source directory.
 java.lang.String getSourceFileName()
          Getter method for this XdcSource's source file name.
 int hashCode()
          This method delegates to the hashCode() method of this XdcSource's File object.
 void setProcessingProperties(java.util.Properties props, java.lang.String prevFileName, java.lang.String nextFileName)
          This method is used to set file specific properties in a given Properties object.
 void setRootComment(java.lang.String rootComment)
          Setter method for this XdcSource's root comment String.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XdcSource

public XdcSource(java.io.File file,
                 java.io.File sourceDir,
                 java.lang.String packageName,
                 DialectHandler handler)
Public constructor.

Parameters:
file - The File object of this XdcSource
sourceDir - The source directory in whose subdirectory tree this XdcSource lies. Note that this does not necessarily mean that this XdcSource lies directly in the source directory (unless the packageName parameter is the empty String).
packageName - The name of the package in which this XdcSource lies
handler - The DialectHandler which controls with which stylesheet this XdcSource is processed
Method Detail

getFile

public java.io.File getFile()
Getter method for this XdcSource's File object.

Returns:
The File object of this XdcSource

getSourceDir

public java.io.File getSourceDir()
Getter method for this XdcSource's source directory.

Returns:
The source directory of this XdcSource

getPackageName

public java.lang.String getPackageName()
Getter method for this XdcSource's package name.

Returns:
The package name of this XdcSource

getDialectHandler

public DialectHandler getDialectHandler()
Getter method for this XdcSource's DialectHandler object.

Returns:
The DialectHandler object of this XdcSource

getRootComment

public java.lang.String getRootComment()
Getter method for this XdcSource's root comment String.

Returns:
The root comment String of this XdcSource

setRootComment

public void setRootComment(java.lang.String rootComment)
Setter method for this XdcSource's root comment String.

Parameters:
rootComment - The root comment String of this XdcSource

getSourceFileName

public java.lang.String getSourceFileName()
Getter method for this XdcSource's source file name.

Returns:
The source file name of this XdcSource

getFileName

public java.lang.String getFileName()
Getter method for this XdcSource's output file name.

Returns:
The output file name of this XdcSource

addPattern

public void addPattern(XPathPattern pattern)
This method stores an XPathPattern (corresponding to a link with an XPath expression anchor) in this XdcSource.

Parameters:
pattern - The XPathPattern to be stored in this XdcSource

getPatterns

public java.util.Properties getPatterns()
This method retrieves all XPathPattern objects stored in this XdcSource in the form of a Properties object (where the links in the source file make up the keys and the XPathPattern values make up the values).

Returns:
A Properties object containing all of this XdcSource's XPathPatterns.

equals

public boolean equals(java.lang.Object o)
This method determines whether this XdcSource is equal to another such object by comparing their respective File objects.

Parameters:
o - An object this XdcSource is to be compared to
Returns:
true if this XdcSource and the one passed as parameter have the same File object; false otherwise

hashCode

public int hashCode()
This method delegates to the hashCode() method of this XdcSource's File object.

Returns:
The hash code of this XdcSource's File object

setProcessingProperties

public void setProcessingProperties(java.util.Properties props,
                                    java.lang.String prevFileName,
                                    java.lang.String nextFileName)
This method is used to set file specific properties in a given Properties object. This object can then be passed to the XSLT stylesheet responsible for processing the XML file.

Parameters:
props - The Properties object to be modified
prevFileName - The name of the file linked via the PREV FILE hyperlink
nextFileName - The name of the file linked via the NEXT FILE hyperlink

clearProcessingProperties

public static void clearProcessingProperties(java.util.Properties props)
This method clears all file specific key-value pairs set in setProcessingProperties(Properties, String, String).

Parameters:
props - The Properties object to be modified

compareTo

public int compareTo(java.lang.Object obj)
This method compares this XdcSource with another one by
(1) their file names and
(2) the names of their respective packages.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
obj - Another XdcSource object
Returns:
The result of the comparison by the above rule

XDC - v. 0.6.1