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

## org.kohsuke.rngom.nc
Class NameClass

    java.lang.Object
      org.kohsuke.rngom.nc.NameClass

All Implemented Interfaces:
  java.io.Serializable, ParsedNameClass

Direct Known Subclasses:
  AnyNameExceptNameClass, ChoiceNameClass, NsNameClass, NsNameExceptNameClass, SimpleNameClass

    public abstract class NameClass

extends java.lang.Object
implements ParsedNameClass, java.io.Serializable

Name class is a set of `QName`s.

See Also:
  Serialized Form

Field Summary
`static NameClass` | `ANY` Sigleton instance that represents "anyName".
`static NameClass` | `NULL` Sigleton instance that accepts no name.

Constructor Summary
`NameClass()`

Method Summary
`abstract
`<V> V`
` | `accept(NameClassVisitor<V> visitor)` Visitor pattern support.
`abstract boolean` | `contains(javax.xml.namespace.QName name)` Returns true if the given `QName` is a valid name for this QName.
`abstract int` | `containsSpecificity(javax.xml.namespace.QName name)`
`boolean` | `hasOverlapWith(NameClass nc2)` Returns true if the intersection between this name class and the specified name class is non-empty.
`abstract boolean` | `isOpen()` Returns true if the name class accepts infinite number of `QName`s.
`java.util.Set<javax.xml.namespace.QName>` | `listNames()` If the name class is closed (IOW !`isOpen()`), return the set of names in this name class.

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

Field Detail

### ANY

    public static final NameClass ANY

  Sigleton instance that represents "anyName".

### NULL

    public static final NameClass NULL

  Sigleton instance that accepts no name.

  This instance is useful when doing boolean arithmetic over name classes (such as computing an inverse of a given name class, etc), even though it can never appear in a RELAX NG surface syntax.

  Internally, this instance is also used for:

  1. Used to recover from errors during parsing.
  2. Mark element patterns with <notAllowed/> content model.

Constructor Detail

### NameClass

    public NameClass()

Method Detail

### contains

    public abstract boolean contains(javax.xml.namespace.QName name)

  Returns true if the given `QName` is a valid name for this QName.

### containsSpecificity

    public abstract int containsSpecificity(javax.xml.namespace.QName name)

### accept

    public abstract <V> V accept(NameClassVisitor<V> visitor)

  Visitor pattern support.

### isOpen

    public abstract boolean isOpen()

  Returns true if the name class accepts infinite number of `QName`s.

  Intuitively, this method returns true if the name class is some sort of wildcard.

### listNames

    public java.util.Set<javax.xml.namespace.QName> listNames()

  If the name class is closed (IOW !`isOpen()`), return the set of names in this name class. Otherwise the behavior is undefined.

### hasOverlapWith

    public final boolean hasOverlapWith(NameClass nc2)

  Returns true if the intersection between this name class and the specified name class is non-empty.

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