Class PackageInspector

All Implemented Interfaces:
Result, Receiver

public class PackageInspector extends ProxyReceiver
The PIGrabber class is a Receiver that looks at an incoming stylesheet document and extracts the package name and version from the root element; parsing is then abandoned.
Author:
Michael H. Kay
  • Method Details

    • startElement

      public void startElement(NodeName namecode, SchemaType typecode, Location location, int properties) throws XPathException
      Abort the parse when the first start element tag is found
      Specified by:
      startElement in interface Receiver
      Overrides:
      startElement in class ProxyReceiver
      Parameters:
      namecode - integer code identifying the name of the element within the name pool.
      typecode - the element's type annotation.
      location - a location associated with the event (typically either a location in the source document or the stylesheet)
      properties - properties of the element node
      Throws:
      XPathException - if an error occurs
    • attribute

      public void attribute(NodeName name, SimpleType typeCode, CharSequence value, Location locationId, int properties) throws XPathException
      Notify an attribute. Attributes are notified after the startElement event, and before any children. Namespaces and attributes may be intermingled.
      Specified by:
      attribute in interface Receiver
      Overrides:
      attribute in class ProxyReceiver
      Parameters:
      name - The name of the attribute
      typeCode - The type of the attribute
      value -
      locationId - the location of the node in the source, or of the instruction that created it
      properties - Bit significant value. The following bits are defined:
      DISABLE_ESCAPING
      Disable escaping for this attribute
      NO_SPECIAL_CHARACTERS
      Attribute value contains no special characters
      Throws:
      XPathException - if an error occurs
    • getPackageDetails

      public static PackageDetails getPackageDetails(File top, Configuration config)