UnmarshallingContext.java revision b87033953be26b0dc7dead8febd499b666a54126
b87033953be26b0dc7dead8febd499b666a54126Peter Major// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v1.0.6-b27-fcs
b87033953be26b0dc7dead8febd499b666a54126Peter Major// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
b87033953be26b0dc7dead8febd499b666a54126Peter Major// Any modifications to this file will be lost upon recompilation of the source schema.
b87033953be26b0dc7dead8febd499b666a54126Peter Major// Generated on: 2012.09.08 at 08:59:44 DU CEST
b87033953be26b0dc7dead8febd499b666a54126Peter Majorpackage com.sun.identity.diagnostic.base.core.jaxbgen.impl.runtime;
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Methods exposed by the unmarshalling coordinator object
b87033953be26b0dc7dead8febd499b666a54126Peter Major * to the generated code.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * This interface will be implemented by the coordinator, which
b87033953be26b0dc7dead8febd499b666a54126Peter Major * converts whatever events (e.g., SAX) into unmarshalling events.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Errors detected by the AbstractUnmarshallingEventHandlerImpl-derived classes should
b87033953be26b0dc7dead8febd499b666a54126Peter Major * be either thrown as {@link UnrepotedException} or reported through
b87033953be26b0dc7dead8febd499b666a54126Peter Major * the handleEvent method of this interface.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
b87033953be26b0dc7dead8febd499b666a54126Peter Majorpublic interface UnmarshallingContext extends NamespaceContext
b87033953be26b0dc7dead8febd499b666a54126Peter Major /** Obtains a reference to the current grammar info. */
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Pushes the current content handler into the stack
b87033953be26b0dc7dead8febd499b666a54126Peter Major * and registers the newly specified content handler so
b87033953be26b0dc7dead8febd499b666a54126Peter Major * that it can receive SAX events.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * @param memento
b87033953be26b0dc7dead8febd499b666a54126Peter Major * When this newly specified handler will be removed from the stack,
b87033953be26b0dc7dead8febd499b666a54126Peter Major * the leaveChild event will be fired to the parent handler
b87033953be26b0dc7dead8febd499b666a54126Peter Major * with this memento.
b87033953be26b0dc7dead8febd499b666a54126Peter Major void pushContentHandler( UnmarshallingEventHandler handler, int memento );
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Pops a content handler from the stack and registers
b87033953be26b0dc7dead8febd499b666a54126Peter Major * it as the current content handler.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * This method will also fire the leaveChild event with the
b87033953be26b0dc7dead8febd499b666a54126Peter Major * associated memento.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Gets the current handler.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Returns a list of prefixes newly declared on this element.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * This method has to be called after the {@link #pushAttributes}
b87033953be26b0dc7dead8febd499b666a54126Peter Major * method is called.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * A possible zero-length array of prefixes. The default prefix
b87033953be26b0dc7dead8febd499b666a54126Peter Major * is represented by the empty string.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Returns a list of all in-scope prefixes.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * A possible zero-length array of prefixes. The default prefix
b87033953be26b0dc7dead8febd499b666a54126Peter Major * is represented by the empty string.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Stores a new attribute set.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * This method should be called by the generated code
b87033953be26b0dc7dead8febd499b666a54126Peter Major * when it "eats" an enterElement event.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * @param collectText
b87033953be26b0dc7dead8febd499b666a54126Peter Major * false if the context doesn't need to fire text events
b87033953be26b0dc7dead8febd499b666a54126Peter Major * for texts inside this element. True otherwise.
b87033953be26b0dc7dead8febd499b666a54126Peter Major void pushAttributes( Attributes atts, boolean collectText );
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Discards the previously stored attribute set.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * This method should be called by the generated code
b87033953be26b0dc7dead8febd499b666a54126Peter Major * when it "eats" a leaveElement event.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Gets the index of the attribute with the specified name.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * This is usually faster when you only need to test with
b87033953be26b0dc7dead8febd499b666a54126Peter Major * a simple name.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * -1 if not found.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Gets all the unconsumed attributes.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * If you need to find attributes based on more complex filter,
b87033953be26b0dc7dead8febd499b666a54126Peter Major * you need to use this method.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Fires an attribute event for the specified attribute,
b87033953be26b0dc7dead8febd499b666a54126Peter Major * and marks the attribute as "used".
b87033953be26b0dc7dead8febd499b666a54126Peter Major void consumeAttribute( int idx ) throws SAXException;
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Marks the attribute as "used" and return the value of the attribute.
b87033953be26b0dc7dead8febd499b666a54126Peter Major String eatAttribute( int idx ) throws SAXException;
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Adds a job that will be executed at the last of the unmarshalling.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * This method is used to support ID/IDREF feature, but it can be used
b87033953be26b0dc7dead8febd499b666a54126Peter Major * for other purposes as well.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * @param job
b87033953be26b0dc7dead8febd499b666a54126Peter Major * The run method of this object is called.
b87033953be26b0dc7dead8febd499b666a54126Peter Major // the patcher can throw JAXBException?
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Adds the object which is currently being unmarshalled
b87033953be26b0dc7dead8febd499b666a54126Peter Major * to the ID table.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Returns the value passed as the parameter.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * This is a hack, but this makes it easier for ID
b87033953be26b0dc7dead8febd499b666a54126Peter Major * transducer to do its job.
b87033953be26b0dc7dead8febd499b666a54126Peter Major // throwing an exception is one way. Overwriting the previous one
b87033953be26b0dc7dead8febd499b666a54126Peter Major // is another way. The latter allows us to process invalid documents,
b87033953be26b0dc7dead8febd499b666a54126Peter Major // while the former makes it impossible to handle them.
b87033953be26b0dc7dead8febd499b666a54126Peter Major // I prefer to be flexible in terms of invalid document handling,
b87033953be26b0dc7dead8febd499b666a54126Peter Major // so chose not to throw an exception.
b87033953be26b0dc7dead8febd499b666a54126Peter Major // I believe this is an implementation choice, not the spec issue.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Looks up the ID table and gets associated object.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * If there is no object associated with the given id,
b87033953be26b0dc7dead8febd499b666a54126Peter Major * this method returns null.
b87033953be26b0dc7dead8febd499b666a54126Peter Major // if we don't find ID.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Gets the current source location information.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Reports an error to the user, and asks if s/he wants
b87033953be26b0dc7dead8febd499b666a54126Peter Major * to recover. If the canRecover flag is false, regardless
b87033953be26b0dc7dead8febd499b666a54126Peter Major * of the client instruction, an exception will be thrown.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Only if the flag is true and the user wants to recover from an error,
b87033953be26b0dc7dead8febd499b666a54126Peter Major * the method returns normally.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * The thrown exception will be catched by the unmarshaller.
b87033953be26b0dc7dead8febd499b666a54126Peter Major void handleEvent( ValidationEvent event, boolean canRecover ) throws SAXException;
b87033953be26b0dc7dead8febd499b666a54126Peter Major// the copy of the org.relaxng.datatype.ValidationContext interface.
b87033953be26b0dc7dead8febd499b666a54126Peter Major// this interface doesn't derive from that interface so that we don't have
b87033953be26b0dc7dead8febd499b666a54126Peter Major// a direct dependency to it, but we provide the same functionality so that
b87033953be26b0dc7dead8febd499b666a54126Peter Major// we can adopt this interface into the ValidationContext interface.
b87033953be26b0dc7dead8febd499b666a54126Peter Major// see the ValidationContextAdaptor class.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Gets a tracer object.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Tracer can be used to trace the unmarshalling behavior.
b87033953be26b0dc7dead8febd499b666a54126Peter Major * Note that to debug the unmarshalling process,
b87033953be26b0dc7dead8febd499b666a54126Peter Major * you have to configure XJC so that it will emit trace codes
b87033953be26b0dc7dead8febd499b666a54126Peter Major * in the unmarshaller.