Top Description Fields Constructors Methods
com.sun.msv.grammar

public abstract Class ReferenceContainer

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Known Direct Subclasses
com.sun.msv.grammar.relax.RELAXModule.ElementRulesContainer, com.sun.msv.grammar.relax.RELAXModule.HedgeRulesContainer, com.sun.msv.grammar.relax.RELAXModule.TagContainer, com.sun.msv.grammar.relax.RELAXModule.AttPoolContainer, com.sun.msv.grammar.trex.TREXGrammar.RefContainer, com.sun.msv.grammar.xmlschema.XMLSchemaSchema.SimpleTypeContainer, com.sun.msv.grammar.xmlschema.XMLSchemaSchema.ComplexTypeContainer, com.sun.msv.grammar.xmlschema.XMLSchemaSchema.AttributeGroupContainer, com.sun.msv.grammar.xmlschema.XMLSchemaSchema.AttributeDeclContainer, com.sun.msv.grammar.xmlschema.XMLSchemaSchema.ElementDeclContainer, com.sun.msv.grammar.xmlschema.XMLSchemaSchema.GroupDeclContainer
Imports
java.util.Iterator, .Map

Container of ReferenceExp. a map from name to ReferenceExp.
Author
Kohsuke KAWAGUCHI

Field Summary

Modifier and TypeField and Description
protected final Map<String, ReferenceExp>
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final ReferenceExp

Returns:

null if no expression is defined with the given name.
_get
(String name)

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

public final ReferenceExp
_getOrCreate(String name)

gets or creates ReferenceExp object.

protected abstract ReferenceExp
createReference(String name)

creates a new reference object with given name

public final ReferenceExp[]
getAll()

obtains all items in this container.

public final Iterator<ReferenceExp>
iterator()

iterates all ReferenceExp in this container

public void
redefine(String name, ReferenceExp newExp)

replaces the current ReferenceExp by newly specified reference exp.

public final ReferenceExp

Returns:

removed object. Null if no such name is found.
remove
(String name)

removes an object from this container.

public final int
size()

gets the number of ReferenceExps in this container.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

implback to summary
protected final Map<String, ReferenceExp> impl
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

ReferenceContainerback to summary
public ReferenceContainer()

Method Detail

_getback to summary
public final ReferenceExp _get(String name)

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

Returns:ReferenceExp

null if no expression is defined with the given name.

_getOrCreateback to summary
public final ReferenceExp _getOrCreate(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.

createReferenceback to summary
protected abstract ReferenceExp createReference(String name)

creates a new reference object with given name

getAllback to summary
public final ReferenceExp[] getAll()

obtains all items in this container.

iteratorback to summary
public final Iterator<ReferenceExp> iterator()

iterates all ReferenceExp in this container

redefineback to summary
public void redefine(String name, ReferenceExp newExp)

replaces the current ReferenceExp by newly specified reference exp.

removeback to summary
public final ReferenceExp remove(String name)

removes an object from this container.

Returns:ReferenceExp

removed object. Null if no such name is found.

sizeback to summary
public final int size()

gets the number of ReferenceExps in this container.