286N/A/*
286N/A * reserved comment block
286N/A * DO NOT REMOVE OR ALTER!
286N/A */
286N/A/*
286N/A * Copyright 2000-2002,2004 The Apache Software Foundation.
286N/A *
286N/A * Licensed under the Apache License, Version 2.0 (the "License");
286N/A * you may not use this file except in compliance with the License.
286N/A * You may obtain a copy of the License at
286N/A *
286N/A * http://www.apache.org/licenses/LICENSE-2.0
286N/A *
286N/A * Unless required by applicable law or agreed to in writing, software
286N/A * distributed under the License is distributed on an "AS IS" BASIS,
286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
286N/A * See the License for the specific language governing permissions and
286N/A * limitations under the License.
286N/A */
286N/A
286N/Apackage com.sun.org.apache.xerces.internal.xni;
286N/A
286N/Aimport com.sun.org.apache.xerces.internal.xni.parser.XMLDTDContentModelSource;
286N/A
286N/A/**
286N/A * The DTD content model handler interface defines callback methods
286N/A * to report information items in DTD content models of an element
286N/A * declaration. Parser components interested in DTD content model
286N/A * information implement this interface and are registered as the DTD
286N/A * content model handler on the DTD content model source.
286N/A *
286N/A * @see XMLDTDHandler
286N/A *
286N/A * @author Andy Clark, IBM
286N/A *
286N/A */
286N/Apublic interface XMLDTDContentModelHandler {
286N/A
286N/A //
286N/A // Constants
286N/A //
286N/A
286N/A // separators
286N/A
286N/A /**
286N/A * A choice separator for children and mixed content models. This
286N/A * separator is used to specify that the allowed child is one of a
286N/A * collection.
286N/A * <p>
286N/A * For example:
286N/A * <pre>
286N/A * &lt;!ELEMENT elem (foo|bar)&gt;
286N/A * &lt;!ELEMENT elem (foo|bar+)&gt;
286N/A * &lt;!ELEMENT elem (foo|bar|baz)&gt;
286N/A * &lt;!ELEMENT elem (#PCDATA|foo|bar)*&gt;
286N/A * </pre>
286N/A *
286N/A * @see #SEPARATOR_SEQUENCE
286N/A */
286N/A public static final short SEPARATOR_CHOICE = 0;
286N/A
286N/A /**
286N/A * A sequence separator for children content models. This separator
286N/A * is used to specify that the allowed children must follow in the
286N/A * specified sequence.
286N/A * <p>
286N/A * <pre>
286N/A * &lt;!ELEMENT elem (foo,bar)&gt;
286N/A * &lt;!ELEMENT elem (foo,bar*)&gt;
286N/A * &lt;!ELEMENT elem (foo,bar,baz)&gt;
286N/A * </pre>
286N/A *
286N/A * @see #SEPARATOR_CHOICE
286N/A */
286N/A public static final short SEPARATOR_SEQUENCE = 1;
286N/A
286N/A // occurrence counts
286N/A
286N/A /**
286N/A * This occurrence count limits the element, choice, or sequence in a
286N/A * children content model to zero or one. In other words, the child
286N/A * is optional.
286N/A * <p>
286N/A * For example:
286N/A * <pre>
286N/A * &lt;!ELEMENT elem (foo?)&gt;
286N/A * </pre>
286N/A *
286N/A * @see #OCCURS_ZERO_OR_MORE
286N/A * @see #OCCURS_ONE_OR_MORE
286N/A */
286N/A public static final short OCCURS_ZERO_OR_ONE = 2;
286N/A
286N/A /**
286N/A * This occurrence count limits the element, choice, or sequence in a
286N/A * children content model to zero or more. In other words, the child
286N/A * may appear an arbitrary number of times, or not at all. This
286N/A * occurrence count is also used for mixed content models.
286N/A * <p>
286N/A * For example:
286N/A * <pre>
286N/A * &lt;!ELEMENT elem (foo*)&gt;
286N/A * &lt;!ELEMENT elem (#PCDATA|foo|bar)*&gt;
286N/A * </pre>
286N/A *
286N/A * @see #OCCURS_ZERO_OR_ONE
286N/A * @see #OCCURS_ONE_OR_MORE
286N/A */
286N/A public static final short OCCURS_ZERO_OR_MORE = 3;
286N/A
286N/A /**
286N/A * This occurrence count limits the element, choice, or sequence in a
286N/A * children content model to one or more. In other words, the child
286N/A * may appear an arbitrary number of times, but must appear at least
286N/A * once.
286N/A * <p>
286N/A * For example:
286N/A * <pre>
286N/A * &lt;!ELEMENT elem (foo+)&gt;
286N/A * </pre>
286N/A *
286N/A * @see #OCCURS_ZERO_OR_ONE
286N/A * @see #OCCURS_ZERO_OR_MORE
286N/A */
286N/A public static final short OCCURS_ONE_OR_MORE = 4;
286N/A
286N/A //
286N/A // XMLDTDContentModelHandler methods
286N/A //
286N/A
286N/A /**
286N/A * The start of a content model. Depending on the type of the content
286N/A * model, specific methods may be called between the call to the
286N/A * startContentModel method and the call to the endContentModel method.
286N/A *
286N/A * @param elementName The name of the element.
286N/A * @param augmentations Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void startContentModel(String elementName, Augmentations augmentations)
286N/A throws XNIException;
286N/A
286N/A /**
286N/A * A content model of ANY.
286N/A *
286N/A * @param augmentations Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A *
286N/A * @see #empty
286N/A * @see #startGroup
286N/A */
286N/A public void any(Augmentations augmentations) throws XNIException;
286N/A
286N/A /**
286N/A * A content model of EMPTY.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A *
286N/A * @param augmentations Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @see #any
286N/A * @see #startGroup
286N/A */
286N/A public void empty(Augmentations augmentations) throws XNIException;
286N/A
286N/A /**
286N/A * A start of either a mixed or children content model. A mixed
286N/A * content model will immediately be followed by a call to the
286N/A * <code>pcdata()</code> method. A children content model will
286N/A * contain additional groups and/or elements.
286N/A *
286N/A * @param augmentations Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A *
286N/A * @see #any
286N/A * @see #empty
286N/A */
286N/A public void startGroup(Augmentations augmentations) throws XNIException;
286N/A
286N/A /**
286N/A * The appearance of "#PCDATA" within a group signifying a
286N/A * mixed content model. This method will be the first called
286N/A * following the content model's <code>startGroup()</code>.
286N/A *
286N/A * @param augmentations Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A *
286N/A * @see #startGroup
286N/A */
286N/A public void pcdata(Augmentations augmentations) throws XNIException;
286N/A
286N/A /**
286N/A * A referenced element in a mixed or children content model.
286N/A *
286N/A * @param elementName The name of the referenced element.
286N/A * @param augmentations Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void element(String elementName, Augmentations augmentations)
286N/A throws XNIException;
286N/A
286N/A /**
286N/A * The separator between choices or sequences of a mixed or children
286N/A * content model.
286N/A *
286N/A * @param separator The type of children separator.
286N/A * @param augmentations Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A *
286N/A * @see #SEPARATOR_CHOICE
286N/A * @see #SEPARATOR_SEQUENCE
286N/A */
286N/A public void separator(short separator, Augmentations augmentations)
286N/A throws XNIException;
286N/A
286N/A /**
286N/A * The occurrence count for a child in a children content model or
286N/A * for the mixed content model group.
286N/A *
286N/A * @param occurrence The occurrence count for the last element
286N/A * or group.
286N/A * @param augmentations Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A *
286N/A * @see #OCCURS_ZERO_OR_ONE
286N/A * @see #OCCURS_ZERO_OR_MORE
286N/A * @see #OCCURS_ONE_OR_MORE
286N/A */
286N/A public void occurrence(short occurrence, Augmentations augmentations)
286N/A throws XNIException;
286N/A
286N/A /**
286N/A * The end of a group for mixed or children content models.
286N/A *
286N/A * @param augmentations Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void endGroup(Augmentations augmentations) throws XNIException;
286N/A
286N/A /**
286N/A * The end of a content model.
286N/A *
286N/A * @param augmentations Additional information that may include infoset
286N/A * augmentations.
286N/A *
286N/A * @throws XNIException Thrown by handler to signal an error.
286N/A */
286N/A public void endContentModel(Augmentations augmentations) throws XNIException;
286N/A
286N/A // set content model source
286N/A public void setDTDContentModelSource(XMLDTDContentModelSource source);
286N/A
286N/A // get content model source
286N/A public XMLDTDContentModelSource getDTDContentModelSource();
286N/A
286N/A} // interface XMLDTDContentModelHandler