Class ComplexAcceptorBaseImpl
- java.lang.Object
-
- com.sun.msv.verifier.regexp.ExpressionAcceptor
-
- com.sun.msv.verifier.regexp.ContentModelAcceptor
-
- com.sun.msv.verifier.regexp.ComplexAcceptorBaseImpl
-
- All Implemented Interfaces:
Acceptor
- Direct Known Subclasses:
ComplexAcceptor
,RulesAcceptor
public abstract class ComplexAcceptorBaseImpl extends ContentModelAcceptor
base implementation of ComplexAcceptor.
-
-
Field Summary
Fields Modifier and Type Field Description protected Expression[]
contents
-
Fields inherited from class com.sun.msv.verifier.regexp.ExpressionAcceptor
docDecl, ignoreUndeclaredAttributes
-
Fields inherited from interface com.sun.msv.verifier.Acceptor
STRING_IGNORE, STRING_PROHIBITED, STRING_STRICT
-
-
Constructor Summary
Constructors Constructor Description ComplexAcceptorBaseImpl(REDocumentDeclaration docDecl, Expression combined, Expression[] contents, boolean ignoreUndeclaredAttributes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
onAttribute(AttributeToken token, StringRef refErr)
boolean
onEndAttributes(StartTagInfo sti, StringRef refErr)
notifies the end of attributes.boolean
onText2(java.lang.String literal, IDContextProvider2 context, StringRef refErr, DatatypeRef refType)
eats string literalboolean
stepForward(Acceptor child, StringRef errRef)
eats a child element-
Methods inherited from class com.sun.msv.verifier.regexp.ContentModelAcceptor
createAcceptor, getOwnerType
-
Methods inherited from class com.sun.msv.verifier.regexp.ExpressionAcceptor
createChildAcceptor, diagnoseUncompletedContent, getExpression, getStringCareLevel, isAcceptState, onAttribute, onAttribute2, onText, stepForward, stepForwardByContinuation
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.sun.msv.verifier.Acceptor
createClone
-
-
-
-
Field Detail
-
contents
protected final Expression[] contents
-
-
Constructor Detail
-
ComplexAcceptorBaseImpl
public ComplexAcceptorBaseImpl(REDocumentDeclaration docDecl, Expression combined, Expression[] contents, boolean ignoreUndeclaredAttributes)
-
-
Method Detail
-
onText2
public final boolean onText2(java.lang.String literal, IDContextProvider2 context, StringRef refErr, DatatypeRef refType)
eats string literal- Specified by:
onText2
in interfaceAcceptor
- Overrides:
onText2
in classExpressionAcceptor
context
- an object that provides context information necessary to validate some datatypes.refErr
- 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
- 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:
- false if the literal at this position is not allowed.
-
stepForward
public final boolean stepForward(Acceptor child, StringRef errRef)
Description copied from interface:Acceptor
eats a child elementA child acceptor created by the
Acceptor.createChildAcceptor(com.sun.msv.util.StartTagInfo,com.sun.msv.util.StringRef)
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.
- Specified by:
stepForward
in interfaceAcceptor
- Overrides:
stepForward
in classContentModelAcceptor
- Returns:
- 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.
-
onAttribute
protected boolean onAttribute(AttributeToken token, StringRef refErr)
- Overrides:
onAttribute
in classExpressionAcceptor
-
onEndAttributes
public boolean onEndAttributes(StartTagInfo sti, StringRef refErr)
Description copied from interface:Acceptor
notifies the end of attributes.This method needs to be called after the
Acceptor.onAttribute(java.lang.String, java.lang.String, java.lang.String, java.lang.String, com.sun.msv.grammar.IDContextProvider, com.sun.msv.util.StringRef, com.sun.msv.util.DatatypeRef)
method is called for each present attribute.An error at this method typically indicates that some required attributes are missing.
- Specified by:
onEndAttributes
in interfaceAcceptor
- Overrides:
onEndAttributes
in classExpressionAcceptor
- Parameters:
sti
- This information is used to produce the error message if that is necessary.refErr
- 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:
- false if an error happens and refErr parameter was not provided. Otherwise true.
-
-