Top Description Fields Constructors Methods
com.sun.msv.verifier.regexp

public abstract Class ComplexAcceptorBaseImpl

extends ContentModelAcceptor
Class Inheritance
Known Direct Subclasses
com.sun.msv.relaxns.verifier.RulesAcceptor, com.sun.msv.verifier.regexp.ComplexAcceptor
Imports
com.sun.msv.grammar.ElementExp, .Expression, .IDContextProvider2, com.sun.msv.util.DatatypeRef, .StartTagInfo, .StringRef, com.sun.msv.verifier.Acceptor

base implementation of ComplexAcceptor.
Author
Kohsuke KAWAGUCHI

Field Summary

Modifier and TypeField and Description
protected final Expression[]

Constructor Summary

AccessConstructor and Description
public
ComplexAcceptorBaseImpl(REDocumentDeclaration docDecl, Expression combined, Expression[] contents, boolean ignoreUndeclaredAttributes)

Method Summary

Modifier and TypeMethod and Description
protected boolean
public boolean
onEndAttributes(StartTagInfo
This information is used to produce the error message if that is necessary.
sti
,
StringRef
In case of an error, this object will receive the localized error message. Null is a valid value for this parameter. The implementation must provide some kind of message.
refErr
)

Overrides com.sun.msv.verifier.regexp.ExpressionAcceptor.onEndAttributes.

Implements com.sun.msv.verifier.Acceptor.onEndAttributes.

notifies the end of attributes.
public final boolean
onText2(String literal, IDContextProvider2
an object that provides context information necessary to validate some datatypes.
context
,
StringRef
if this parameter is non-null, the implementation should try to detect the reason of error and recover from it. and this object should have the error message as its str field.
refErr
,
DatatypeRef
if this parameter is non-null and the callee supports type-assignment, the callee will assign the DataType object to this variable. Caller must initialize refType.type to null before calling this method. If the callee doesn't support type-assignment or type-assignment is impossible for this literal (possibly by ambiguous grammar), this variable must kept null.
refType
)

Overrides com.sun.msv.verifier.regexp.ExpressionAcceptor.onText2.

Implements com.sun.msv.verifier.Acceptor.onText2.

eats string literal
public final boolean
stepForward(Acceptor child, StringRef errRef)

Overrides com.sun.msv.verifier.regexp.ContentModelAcceptor.stepForward.

Implements com.sun.msv.verifier.Acceptor.stepForward.

eats a child element

A child acceptor created by the createChildAcceptor method will be ultimately consumed by the parent through this method.

Inherited from com.sun.msv.verifier.regexp.ContentModelAcceptor:
createAcceptorgetOwnerType

Field Detail

contentsback to summary
protected final Expression[] contents

Constructor Detail

ComplexAcceptorBaseImplback to summary
public ComplexAcceptorBaseImpl(REDocumentDeclaration docDecl, Expression combined, Expression[] contents, boolean ignoreUndeclaredAttributes)

Method Detail

onAttributeback to summary
protected boolean onAttribute(AttributeToken token, StringRef refErr)

Overrides com.sun.msv.verifier.regexp.ExpressionAcceptor.onAttribute.

onEndAttributesback to summary
public boolean onEndAttributes(StartTagInfo sti, StringRef refErr)

Overrides com.sun.msv.verifier.regexp.ExpressionAcceptor.onEndAttributes.

Implements com.sun.msv.verifier.Acceptor.onEndAttributes.

Doc from com.sun.msv.verifier.Acceptor.onEndAttributes.

notifies the end of attributes.

This method needs to be called after the onAttribute method is called for each present attribute.

An error at this method typically indicates that some required attributes are missing.

Parameters
sti:StartTagInfo

This information is used to produce the error message if that is necessary.

refErr:StringRef

In case of an error, this object will receive the localized error message. Null is a valid value for this parameter. The implementation must provide some kind of message.

Returns:boolean

false if an error happens and refErr parameter was not provided. Otherwise true.

onText2back to summary
public final boolean onText2(String literal, IDContextProvider2 context, StringRef refErr, DatatypeRef refType)

Overrides com.sun.msv.verifier.regexp.ExpressionAcceptor.onText2.

Implements com.sun.msv.verifier.Acceptor.onText2.

eats string literal

Parameters
context:IDContextProvider2

Doc from com.sun.msv.verifier.Acceptor.onText2.

an object that provides context information necessary to validate some datatypes.

refErr:StringRef

Doc from com.sun.msv.verifier.Acceptor.onText2.

if this parameter is non-null, the implementation should try to detect the reason of error and recover from it. and this object should have the error message as its str field.

refType:DatatypeRef

Doc from com.sun.msv.verifier.Acceptor.onText2.

if this parameter is non-null and the callee supports type-assignment, the callee will assign the DataType object to this variable. Caller must initialize refType.type to null before calling this method. If the callee doesn't support type-assignment or type-assignment is impossible for this literal (possibly by ambiguous grammar), this variable must kept null.

Returns:boolean

Doc from com.sun.msv.verifier.Acceptor.onText2.

false if the literal at this position is not allowed.

stepForwardback to summary
public final boolean stepForward(Acceptor child, StringRef errRef)

Overrides com.sun.msv.verifier.regexp.ContentModelAcceptor.stepForward.

Implements com.sun.msv.verifier.Acceptor.stepForward.

Doc from com.sun.msv.verifier.Acceptor.stepForward.

eats a child element

A child acceptor created by the createChildAcceptor method will be ultimately consumed by the parent through this method.

It is the caller's responsibility to make sure that child acceptor is in the accept state. If it's not, that indicates that some required elements are missing (in other words, contents are not allowed to end here).

It is the callee's responsibility to recover from error of unsatisified child acceptor. That is, even if the caller finds that there are missing elements, it is possible to call this method as if there was no such error.

Returns:boolean

false if an error happens. For example, if the implementation passes an acceptor which is NOT a child of this acceptor, then the callee can return false.