Top Description Constructors Methods
com.sun.xml.xsom.parser

public abstract Class AnnotationParser

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.xml.xsom.util.DomAnnotationParserFactory.AnnotationParserImpl, com.sun.xml.xsom.impl.parser.DefaultAnnotationParser
Imports
org.xml.sax.ContentHandler, .EntityResolver, .ErrorHandler

Used to parse <xs:annotation>.
Author
Kohsuke Kawaguchi ([email protected])

Constructor Summary

AccessConstructor and Description
protected
AnnotationParser()

Default constructor.

Method Summary

Modifier and TypeMethod and Description
public abstract ContentHandler
getContentHandler(AnnotationContext
indicates the schema component that owns this annotation. Always non-null.
context
,
String
local name of the element that contains <xs:annotation>. (e.g., "element", "attribute", ... )
parentElementName
,
ErrorHandler
The error handler that the client application specifies. The returned content handler can send its errors to this object.
errorHandler
,
EntityResolver
The entity resolver that is currently in use. Again, The returned content handler can use this object if it needs to resolve entities.
entityResolver
)

Called every time a new <xs:annotation> element is found.

public abstract Object

Returns:

Any object, including null.
getResult
(Object
An annotation object which was returned from another AnnotationParser before. Sometimes, one schema component can have multiple <xs:annotation> elements and this parameter is used to merge all those annotations together. If there is no existing object, null will be passed.
existing
)

Once the SAX events are fed to the ContentHandler, this method will be called to retrieve the parsed result.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AnnotationParserback to summary
protected AnnotationParser()

Default constructor.

Method Detail

getContentHandlerback to summary
public abstract ContentHandler getContentHandler(AnnotationContext context, String parentElementName, ErrorHandler errorHandler, EntityResolver entityResolver)

Called every time a new <xs:annotation> element is found. The sub-tree rooted at <xs:annotation> will be sent to this ContentHandler as if it is a whole document.

Parameters
context:AnnotationContext

indicates the schema component that owns this annotation. Always non-null.

parentElementName:String

local name of the element that contains <xs:annotation>. (e.g., "element", "attribute", ... )

errorHandler:ErrorHandler

The error handler that the client application specifies. The returned content handler can send its errors to this object.

entityResolver:EntityResolver

The entity resolver that is currently in use. Again, The returned content handler can use this object if it needs to resolve entities.

getResultback to summary
public abstract Object getResult(Object existing)

Once the SAX events are fed to the ContentHandler, this method will be called to retrieve the parsed result.

Parameters
existing:Object

An annotation object which was returned from another AnnotationParser before. Sometimes, one schema component can have multiple <xs:annotation> elements and this parameter is used to merge all those annotations together. If there is no existing object, null will be passed.

Returns:Object

Any object, including null.