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
Class ReferenceContainer

    java.lang.Object
      com.sun.msv.grammar.ReferenceContainer

All Implemented Interfaces:
  java.io.Serializable

Direct Known Subclasses:
  RELAXModule.AttPoolContainer, RELAXModule.ElementRulesContainer, RELAXModule.HedgeRulesContainer, RELAXModule.TagContainer, TREXGrammar.RefContainer, XMLSchemaSchema.AttributeDeclContainer, XMLSchemaSchema.AttributeGroupContainer, XMLSchemaSchema.ComplexTypeContainer, XMLSchemaSchema.ElementDeclContainer, XMLSchemaSchema.GroupDeclContainer, XMLSchemaSchema.SimpleTypeContainer

public abstract class ReferenceContainer
extends java.lang.Object
implements java.io.Serializable

Container of ReferenceExp. a map from name to ReferenceExp.

Author:
  Kohsuke KAWAGUCHI
See Also:
  Serialized Form

Constructor Summary
`ReferenceContainer()`

Method Summary
`ReferenceExp` | `_get(java.lang.String name)` gets a referenced expression Derived class should provide type-safe accesser methods.
`ReferenceExp` | `_getOrCreate(java.lang.String name)` gets or creates ReferenceExp object.
`ReferenceExp[]` | `getAll()` obtains all items in this container.
`java.util.Iterator` | `iterator()` iterates all ReferenceExp in this container
`void` | `redefine(java.lang.String name, ReferenceExp newExp)` replaces the current ReferenceExp by newly specified reference exp.
`ReferenceExp` | `remove(java.lang.String name)` removes an object from this container.
`int` | `size()` gets the number of ReferenceExps in this container.

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

Constructor Detail

### ReferenceContainer

    public ReferenceContainer()

Method Detail

### _getOrCreate

    public final ReferenceExp _getOrCreate(java.lang.String name)

  gets or creates ReferenceExp object. Derived class should provide type-safe accesser methods. Usually, this method is only necessary for some kind of grammar loader. If you are programming an application over MSV, `_get(String)` method is probably what you need.

### redefine

    public void redefine(java.lang.String name,
                         ReferenceExp newExp)

  replaces the current ReferenceExp by newly specified reference exp.

### _get

    public final ReferenceExp _get(java.lang.String name)

  gets a referenced expression Derived class should provide type-safe accesser methods.

  Returns:
    null if no expression is defined with the given name.

### iterator

    public final java.util.Iterator iterator()

  iterates all ReferenceExp in this container

### getAll

    public final ReferenceExp[] getAll()

  obtains all items in this container.

### remove

    public final ReferenceExp remove(java.lang.String name)

  removes an object from this container.

  Returns:
    removed object. Null if no such name is found.

### size

    public final int size()

  gets the number of ReferenceExps in this container.

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