com.mathling.scd
Class SCD

java.lang.Object
  extended by com.mathling.scd.SCD

public class SCD
extends java.lang.Object

Schema component paths. Provides simple generation and interpretation of schema component paths against a Xerces assembled schema. Currently the Xerces API does not support XML Schema 1.1 components; therefore neither does this API.

Copyright (c) 2005-2010 Mary Holstege.

Author:
Mary Holstege (nojunk@mathling.com)

Constructor Summary
SCD(java.util.Map<java.lang.String,java.lang.String> namespaces, boolean includeXSD, boolean includeAnnotations, boolean abbreviations)
          Constructor.
 
Method Summary
 void generate(org.apache.xerces.xs.XSModel model, int level)
          Generate the schema component paths for the grammar.
 void locate(org.apache.xerces.xs.XSModel model, java.lang.String path, java.util.List<java.lang.Object> results)
          Locate the schema component indicated by the path in the assembled schema.
 void serialize(java.lang.Object component)
          Serialize the schema component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SCD

public SCD(java.util.Map<java.lang.String,java.lang.String> namespaces,
           boolean includeXSD,
           boolean includeAnnotations,
           boolean abbreviations)
Constructor.

Parameters:
namespaces - A map from namespace URIs to prefixes.
includeXSD - Whether to generate paths in the XML Schema namespace.
includeAnnotations - Whether to generate paths to annotations.
abbreviations - Whether to use abbreviations in the paths
Method Detail

serialize

public void serialize(java.lang.Object component)
Serialize the schema component.

Parameters:
component - The schema component to serialize

generate

public void generate(org.apache.xerces.xs.XSModel model,
                     int level)
Generate the schema component paths for the grammar.

Parameters:
model - The grammar model (assembled schema).
level - How many levels deep to go in generating paths. A value of 0 means that only canonical schema component paths will be generated.

locate

public void locate(org.apache.xerces.xs.XSModel model,
                   java.lang.String path,
                   java.util.List<java.lang.Object> results)
Locate the schema component indicated by the path in the assembled schema. Currently this method will just serialize some information about the located component to standard out. It also does not currently implement paths that return sets of components. It is expected that this method will be replaced by a more general locator API.

Parameters:
model - The grammar model (assembled schema).
path - The path to interpret.