com.sun.msv.verifier.regexp
Class REDocumentDeclaration

java.lang.Object
  |
  +--com.sun.msv.verifier.regexp.REDocumentDeclaration
All Implemented Interfaces:
DocumentDeclaration
Direct Known Subclasses:
XSREDocDecl

public class REDocumentDeclaration
extends Object
implements DocumentDeclaration

DocumentDeclaration implementation Grammar object can be shared among multiple threads, but this object cannot be shared.

REDocumentDeclaration always returns subclasses of ExpressionAcceptor as the Acceptor implementation.

Author:
Kohsuke KAWAGUCHI

Field Summary
 AttributeToken attToken
          the AttributeToken object which is re-used
static String DIAG_BAD_ATTRIBUTE_VALUE_DATATYPE
           
static String DIAG_BAD_ATTRIBUTE_VALUE_GENERIC
           
static String DIAG_BAD_ATTRIBUTE_VALUE_MORE
           
static String DIAG_BAD_ATTRIBUTE_VALUE_SEPARATOR
           
static String DIAG_BAD_ATTRIBUTE_VALUE_WRAPUP
           
static String DIAG_BAD_KEY_VALUE
           
static String DIAG_BAD_KEY_VALUE2
           
static String DIAG_BAD_LITERAL_MORE
           
static String DIAG_BAD_LITERAL_SEPARATOR
           
static String DIAG_BAD_LITERAL_WRAPUP
           
static String DIAG_BAD_TAGNAME_GENERIC
           
static String DIAG_BAD_TAGNAME_MORE
           
static String DIAG_BAD_TAGNAME_PROBABLY_WRONG_NAMESPACE
           
static String DIAG_BAD_TAGNAME_SEPARATOR
           
static String DIAG_BAD_TAGNAME_WRAPUP
           
static String DIAG_BAD_TAGNAME_WRONG_NAMESPACE
           
static String DIAG_CONTENT_MODEL_IS_NULLSET
           
static String DIAG_ELEMENT_NOT_ALLOWED
           
static String DIAG_MISSING_ATTRIBUTE_GENERIC
           
static String DIAG_MISSING_ATTRIBUTE_MORE
           
static String DIAG_MISSING_ATTRIBUTE_SEPARATOR
           
static String DIAG_MISSING_ATTRIBUTE_SIMPLE
           
static String DIAG_MISSING_ATTRIBUTE_WRAPUP
           
static String DIAG_NAMESPACE_NAMECLASS
           
static String DIAG_NOT_NAMESPACE_NAMECLASS
           
static String DIAG_SIMPLE_NAMECLASS
           
static String DIAG_STRING_NOT_ALLOWED
           
static String DIAG_UNCOMPLETED_CONTENT_MORE
           
static String DIAG_UNCOMPLETED_CONTENT_SEPARATOR
           
static String DIAG_UNCOMPLETED_CONTENT_WRAPUP
           
static String DIAG_UNDECLARED_ATTRIBUTE
           
 ExpressionPool pool
          ExpressionPool object that this VGM uses.
 
Constructor Summary
REDocumentDeclaration(Expression topLevel, ExpressionPool pool)
          creates an object that validates the specified expression.
REDocumentDeclaration(Grammar grammar)
           
 
Method Summary
 Acceptor createAcceptor()
          creates a new Acceptor that will validate the document element.
 String localizeMessage(String propName, Object arg1)
           
 String localizeMessage(String propertyName, Object[] args)
           
 String localizeMessage(String propName, Object arg1, Object arg2)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pool

public final ExpressionPool pool
ExpressionPool object that this VGM uses.

attToken

public final AttributeToken attToken
the AttributeToken object which is re-used

Only one AttributeToken object is used during 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. So instead of creating new object every time the method is called, we can kept using one copy.

Note: other parts of the code may never rely on the fact that the attribute token is cached and reused.

Note: this field should be accessed ONLY by the ExpressionAcceptor.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.


DIAG_ELEMENT_NOT_ALLOWED

public static final String DIAG_ELEMENT_NOT_ALLOWED

DIAG_CONTENT_MODEL_IS_NULLSET

public static final String DIAG_CONTENT_MODEL_IS_NULLSET

DIAG_BAD_TAGNAME_GENERIC

public static final String DIAG_BAD_TAGNAME_GENERIC

DIAG_BAD_TAGNAME_WRAPUP

public static final String DIAG_BAD_TAGNAME_WRAPUP

DIAG_BAD_TAGNAME_SEPARATOR

public static final String DIAG_BAD_TAGNAME_SEPARATOR

DIAG_BAD_TAGNAME_MORE

public static final String DIAG_BAD_TAGNAME_MORE

DIAG_BAD_TAGNAME_WRONG_NAMESPACE

public static final String DIAG_BAD_TAGNAME_WRONG_NAMESPACE

DIAG_BAD_TAGNAME_PROBABLY_WRONG_NAMESPACE

public static final String DIAG_BAD_TAGNAME_PROBABLY_WRONG_NAMESPACE

DIAG_UNDECLARED_ATTRIBUTE

public static final String DIAG_UNDECLARED_ATTRIBUTE

DIAG_BAD_ATTRIBUTE_VALUE_GENERIC

public static final String DIAG_BAD_ATTRIBUTE_VALUE_GENERIC

DIAG_BAD_ATTRIBUTE_VALUE_DATATYPE

public static final String DIAG_BAD_ATTRIBUTE_VALUE_DATATYPE

DIAG_BAD_ATTRIBUTE_VALUE_WRAPUP

public static final String DIAG_BAD_ATTRIBUTE_VALUE_WRAPUP

DIAG_BAD_ATTRIBUTE_VALUE_SEPARATOR

public static final String DIAG_BAD_ATTRIBUTE_VALUE_SEPARATOR

DIAG_BAD_ATTRIBUTE_VALUE_MORE

public static final String DIAG_BAD_ATTRIBUTE_VALUE_MORE

DIAG_MISSING_ATTRIBUTE_SIMPLE

public static final String DIAG_MISSING_ATTRIBUTE_SIMPLE

DIAG_MISSING_ATTRIBUTE_GENERIC

public static final String DIAG_MISSING_ATTRIBUTE_GENERIC

DIAG_MISSING_ATTRIBUTE_WRAPUP

public static final String DIAG_MISSING_ATTRIBUTE_WRAPUP

DIAG_MISSING_ATTRIBUTE_SEPARATOR

public static final String DIAG_MISSING_ATTRIBUTE_SEPARATOR

DIAG_MISSING_ATTRIBUTE_MORE

public static final String DIAG_MISSING_ATTRIBUTE_MORE

DIAG_UNCOMPLETED_CONTENT_WRAPUP

public static final String DIAG_UNCOMPLETED_CONTENT_WRAPUP

DIAG_UNCOMPLETED_CONTENT_SEPARATOR

public static final String DIAG_UNCOMPLETED_CONTENT_SEPARATOR

DIAG_UNCOMPLETED_CONTENT_MORE

public static final String DIAG_UNCOMPLETED_CONTENT_MORE

DIAG_BAD_LITERAL_WRAPUP

public static final String DIAG_BAD_LITERAL_WRAPUP

DIAG_BAD_LITERAL_SEPARATOR

public static final String DIAG_BAD_LITERAL_SEPARATOR

DIAG_BAD_LITERAL_MORE

public static final String DIAG_BAD_LITERAL_MORE

DIAG_SIMPLE_NAMECLASS

public static final String DIAG_SIMPLE_NAMECLASS

DIAG_NAMESPACE_NAMECLASS

public static final String DIAG_NAMESPACE_NAMECLASS

DIAG_NOT_NAMESPACE_NAMECLASS

public static final String DIAG_NOT_NAMESPACE_NAMECLASS

DIAG_STRING_NOT_ALLOWED

public static final String DIAG_STRING_NOT_ALLOWED

DIAG_BAD_KEY_VALUE

public static final String DIAG_BAD_KEY_VALUE

DIAG_BAD_KEY_VALUE2

public static final String DIAG_BAD_KEY_VALUE2
Constructor Detail

REDocumentDeclaration

public REDocumentDeclaration(Grammar grammar)

REDocumentDeclaration

public REDocumentDeclaration(Expression topLevel,
                             ExpressionPool pool)
creates an object that validates the specified expression.
Method Detail

createAcceptor

public Acceptor createAcceptor()
Description copied from interface: DocumentDeclaration
creates a new Acceptor that will validate the document element. In RELAX, this concept is equivalent to <topLevel> In TREX, this concept is equivalent to <start>
Specified by:
createAcceptor in interface DocumentDeclaration
Following copied from interface: com.sun.msv.verifier.DocumentDeclaration
Returns:
The implementation cannot return null. Apparently, it is impossible to fail in this early stage.

localizeMessage

public String localizeMessage(String propertyName,
                              Object[] args)

localizeMessage

public final String localizeMessage(String propName,
                                    Object arg1)

localizeMessage

public final String localizeMessage(String propName,
                                    Object arg1,
                                    Object arg2)