|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.xml.SourceProcessor
public class SourceProcessor
Objects of the SourceProcessor class are designed to receive a Collection containing TypedInputSource objects, that is, typed XML InputSources. The SourceProcessor will process each in turn, generating XML or XTM Documents, depending on source type.
Planned is a syntax processor API, where rather than the SourceProcessor class "knowing" about each particular syntax processor, the driver application instantiates each processor, which then in turn registers itself with this class, keyed by processed file type. Then, the channelSource method hands off the TypedInputSource to the correct processor in turn.
Constants| Field Summary | |
|---|---|
static String |
DEFAULT_PARSER_NAME
Default parser name. |
static String |
LEXICAL_HANDLER_PROPERTY_ID
Lexical handler property id (http://xml.org/sax/properties/lexical-handler). |
static String |
NAMESPACES_FEATURE_ID
Namespaces feature id (http://xml.org/sax/features/namespaces). |
boolean |
normalizeWS
When true indicates that whitespace in content should be normalized. |
protected int |
plinkMode
an int indicating the current Plink mode. |
boolean |
prettyPrint
When true pretty-print indents serialized XML content. |
static String |
SCHEMA_VALIDATION_FEATURE_ID
Schema validation feature id (http://apache.org/xml/features/validation/schema). |
static String |
VALIDATION_FEATURE_ID
Validation feature id (http://xml.org/sax/features/validation). |
| Constructor Summary | |
|---|---|
SourceProcessor()
Default constructor. |
|
| Method Summary | |
|---|---|
Object |
channelSource(TypedInputSource source)
Processes the TypedInputSource source according to its file type, generally returning a DOM Document if the source was XML, or an TopicMap object otherwise (this all depends on file type), or even a Swing Document. |
PlinkProcessor |
getPlinkProcessor()
Returns this SourceProcessor's PlinkProcessor. |
TypedInputSource |
getTypedInputSourceFromString(String source)
Returns an TypedInputSource whose source is a StringReader populated with the the contents of the String source, assuming the content to be well-formed XML. |
Document |
importPDB(TypedInputSource source)
This passes the message on to the currently-open DocumentView (which initiated the action). |
TopicMap |
parseTM(TypedInputSource source)
Parses the XTM, LTM, or AsTMa= file source to generate a TopicMap. |
Document |
parseXML(TypedInputSource source)
Parses the XML file as a TypedInputSource source to populate and return a Document. |
int |
processSources(Collection sources)
Processes the available sources, a Collection containing zero or more TypedInputSource objects, using the various parser and processor classes, returning the number of files processed. |
void |
setMessageWriter(MessageWriter msgwriter)
Sets the MessageWriter used for interactive I/O to the application. |
void |
setOutputFile(String systemId)
Sets the output file system identifier (pathname) used for writing to the String systemId. |
void |
setPlinkMode(int mode)
Sets the operational mode for plink to the String mode. |
void |
writeTopicMap(TopicMap topicmap,
String systemId)
Processes the TopicMap topicmap to produce a generated XML document output as systemId. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String NAMESPACES_FEATURE_ID
public static final String VALIDATION_FEATURE_ID
public static final String SCHEMA_VALIDATION_FEATURE_ID
public static final String LEXICAL_HANDLER_PROPERTY_ID
public static final String DEFAULT_PARSER_NAME
public boolean prettyPrint
public boolean normalizeWS
protected int plinkMode
PlinkProcessor| Constructor Detail |
|---|
public SourceProcessor()
| Method Detail |
|---|
public void setOutputFile(String systemId)
public void setPlinkMode(int mode)
PlinkProcessorpublic void setMessageWriter(MessageWriter msgwriter)
public PlinkProcessor getPlinkProcessor()
public Document parseXML(TypedInputSource source)
throws ProcessException
ProcessExceptionpublic TopicMap parseTM(TypedInputSource source)
public Document importPDB(TypedInputSource source)
public void writeTopicMap(TopicMap topicmap,
String systemId)
public Object channelSource(TypedInputSource source)
throws ProcessException
ProcessExceptionpublic TypedInputSource getTypedInputSourceFromString(String source)
public int processSources(Collection sources)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||