com.sun.msv.verifier.regexp

Class ExpressionAcceptor

public abstract class ExpressionAcceptor extends Object implements Acceptor

Acceptor implementation.

When you are using REDocumentDeclaration, then the acceptor is always guaranteed to be a subclass of this class. Therefore, by using this regexp implementation of VGM, you can always downcast Acceptor to this class and access its contents to get more information.

If you consider VGM as an automaton, this class can be thought as a lazy automaton acceptor.

Author: Kohsuke KAWAGUCHI

Constructor Summary
ExpressionAcceptor(REDocumentDeclaration docDecl, Expression exp, boolean ignoreUndeclaredAttributes)
Method Summary
AcceptorcreateChildAcceptor(StartTagInfo tag, StringRef errRef)
creates combined child acceptor and primitive child acceptors (if necessary). be careful not to keep returned object too long because it is reused whenever the method is called.
ExpressiongetExpression()
gets the residual content model.
intgetStringCareLevel()
booleanisAcceptState(StringRef errRef)
checks if this Acceptor is satisifed
booleanonAttribute(String namespaceURI, String localName, String qName, String value, IDContextProvider context, StringRef refErr, DatatypeRef refType)
booleanonAttribute2(String namespaceURI, String localName, String qName, String value, IDContextProvider2 context, StringRef refErr, DatatypeRef refType)
booleanonEndAttributes(StartTagInfo sti, StringRef refErr)
booleanonText(String literal, IDContextProvider context, StringRef refErr, DatatypeRef refType)
booleanonText2(String literal, IDContextProvider2 provider, StringRef refErr, DatatypeRef refType)
booleanstepForwardByContinuation(Expression continuation, StringRef errRef)

Constructor Detail

ExpressionAcceptor

public ExpressionAcceptor(REDocumentDeclaration docDecl, Expression exp, boolean ignoreUndeclaredAttributes)

Method Detail

createChildAcceptor

public Acceptor createChildAcceptor(StartTagInfo tag, StringRef errRef)
creates combined child acceptor and primitive child acceptors (if necessary). be careful not to keep returned object too long because it is reused whenever the method is called.

Returns: null if errRef is null and this expression cannot accept given start tag. if errRef is non-null and error recovery is not possible.

getExpression

public Expression getExpression()
gets the residual content model.

This method returns the expression that represents the expected content model it will read. For example, if the original content model is (A,(B|C)) and this acceptor has already read A, then this method returns (B|C).

The returned residual is useful to find out what elements can appear next.

If you consider VGM as an automaton, the residual content model can be thought as the current state. Also, At the same time, right language (a regular expression that represents the language it can accept from now on).

getStringCareLevel

public int getStringCareLevel()

isAcceptState

public boolean isAcceptState(StringRef errRef)
checks if this Acceptor is satisifed

onAttribute

public final boolean onAttribute(String namespaceURI, String localName, String qName, String value, IDContextProvider context, StringRef refErr, DatatypeRef refType)

Deprecated:

onAttribute2

public final boolean onAttribute2(String namespaceURI, String localName, String qName, String value, IDContextProvider2 context, StringRef refErr, DatatypeRef refType)

onEndAttributes

public boolean onEndAttributes(StartTagInfo sti, StringRef refErr)

onText

public final boolean onText(String literal, IDContextProvider context, StringRef refErr, DatatypeRef refType)

Deprecated:

onText2

public boolean onText2(String literal, IDContextProvider2 provider, StringRef refErr, DatatypeRef refType)

stepForwardByContinuation

public final boolean stepForwardByContinuation(Expression continuation, StringRef errRef)