1
2
3
4
5
6
7
8 package net.sf.jour.rt.view.config.impl.runtime;
9
10 import javax.xml.bind.JAXBException;
11
12 /***
13 * Keeps the information about the grammar as a whole.
14 *
15 * Implementation of this interface is provided by the generated code.
16 *
17 * @author
18 * <a href="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a>
19 */
20 public interface GrammarInfo
21 {
22 /***
23 * Creates an unmarshaller that can unmarshal a given element.
24 *
25 * @param namespaceUri
26 * The string needs to be interned by the caller
27 * for a performance reason.
28 * @param localName
29 * The string needs to be interned by the caller
30 * for a performance reason.
31 *
32 * @return
33 * null if the given name pair is not recognized.
34 */
35 UnmarshallingEventHandler createUnmarshaller(
36 String namespaceUri, String localName, UnmarshallingContext context );
37
38 /***
39 * Creates an instance for the root element.
40 *
41 * @return
42 * null if the given name pair is not recognized.
43 */
44 Class getRootElement(String namespaceUri, String localName);
45
46 /***
47 * Return the probe points for this GrammarInfo, which are used to detect
48 * {namespaceURI,localName} collisions across the GrammarInfo's on the
49 * schemaPath. This is a slightly more complex implementation than a simple
50 * hashmap, but it is more flexible in supporting additional schema langs.
51 */
52 String[] getProbePoints();
53
54 /***
55 * Returns true if the invocation of the createUnmarshaller method
56 * will return a non-null value for the given name pair.
57 *
58 * @param nsUri
59 * The string needs to be interned by the caller
60 * for a performance reason.
61 * @param localName
62 * The string needs to be interned by the caller
63 * for a performance reason.
64 */
65 boolean recognize( String nsUri, String localName );
66
67 /***
68 * Gets the default implementation for the given public content
69 * interface.
70 *
71 * @param javaContentInterface
72 * the Class object of the public interface.
73 *
74 * @return null
75 * If the interface is not found.
76 */
77 Class getDefaultImplementation( Class javaContentInterface );
78
79 /***
80 * Gets the MSV AGM which can be used to validate XML during
81 * marshalling/unmarshalling.
82 */
83 com.sun.msv.grammar.Grammar getGrammar() throws JAXBException;
84
85
86 XMLSerializable castToXMLSerializable( Object o );
87
88
89 ValidatableObject castToValidatableObject(Object o);
90 }