Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.msv.grammar.xmlschema
Class LaxDefaultNameClass

    java.lang.Object
      com.sun.msv.grammar.NameClass
          com.sun.msv.grammar.xmlschema.LaxDefaultNameClass

All Implemented Interfaces:
  java.io.Serializable

public class LaxDefaultNameClass
extends NameClass

Special name class implementation used for the wild card of the "lax" mode.

In "lax" mode, we need a name class that matches all undefined names. Although it is possible to use DifferenceNameClass for this purpose, it is not a cost-efficient way because typically it becomes very large. (If there are twenty element declarations, we'll need twenty DifferenceNameClass to exclude all defined names).

This name class uses a `Set` to hold multiple names. If a name is contained in that set, it'll be rejected. If a name is not contained, it'll be accepted.

Special care is taken to make this NC as seamless as possible. When the visit method is called, the equivalent name class is constructed internally and the visitor will visit that name class. In this way, the visitors won't notice the existance of this "special" name class.

Author:
  Kohsuke KAWAGUCHI
See Also:
  Serialized Form

Field Summary

Fields inherited from class com.sun.msv.grammar.NameClass
`ALL, LOCALNAME_WILDCARD, NAMESPACE_WILDCARD, NONE`

Constructor Summary
`LaxDefaultNameClass(NameClass _base)`

Method Summary
`boolean` | `accepts(java.lang.String namespaceURI, java.lang.String localName)` checks if this name class accepts given namespace:localName pair.
`void` | `addName(java.lang.String namespaceURI, java.lang.String localName)` add a name so that this name will be rejected by the accepts method.
`java.lang.Object` | `visit(NameClassVisitor visitor)` visitor pattern support

Methods inherited from class com.sun.msv.grammar.NameClass
`accepts, includes, intersection, isEqualTo, isNull, simplify, union`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### LaxDefaultNameClass

    public LaxDefaultNameClass(NameClass _base)

Parameters:
  `_base` - this name class accepts a name if
  1. it's in the 'base" name class and
  2. it's not one of those excluded names

Method Detail

### visit

    public java.lang.Object visit(NameClassVisitor visitor)

  Description copied from class: `NameClass`
  visitor pattern support

  Specified by:
    `visit` in class `NameClass`

### accepts

    public boolean accepts(java.lang.String namespaceURI,
                           java.lang.String localName)

  Description copied from class: `NameClass`
  checks if this name class accepts given namespace:localName pair.

  Specified by:
    `accepts` in class `NameClass`
  Parameters:
    `namespaceURI` - namespace URI to be tested. If this value equals to NAMESPACE_WILDCARD, implementation must assume that valid namespace is specified. this twist will be used for error diagnosis.
    `localName` - local part to be tested. As with namespaceURI, LOCALNAME_WILDCARD will acts as a wild card.
  Returns:
    true if the pair is accepted, false otherwise.

### addName

    public void addName(java.lang.String namespaceURI,
                        java.lang.String localName)

  add a name so that this name will be rejected by the accepts method.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD