-
Notifications
You must be signed in to change notification settings - Fork 17
XDI2 parsers
Most of the functionality of the xdi2-core component requires a parser to validate XDI statements and addresses, and to decompose them into their parts. A number of different parsers are available to do this job.
- xdi2.core.syntax.ParserRegistry: A registry that holds the currently used parser.
- xdi2.core.syntax.apg.APGParser: A parser based on the recursive-descent APG parser generator.
- xdi2.core.syntax.aparse.AParseParser: A parser based on the aParse parser generator.
- xdi2.core.syntax.manual.ManualParser: A parser implemented manually in pure Java.
XDI2 can be programmatically configured to use a certain parser:
ParserRegistry.getInstance().setParser(new ManualParser());
This can also be accomplished in the applicationContext.xml configuration file of the xdi2-transport-http component. (See Configuration files for a description of this and other files):
<bean class="xdi2.core.syntax.ParserRegistry" factory-method="getInstance">
<property name="parser">
<bean class="xdi2.core.syntax.apg.ManualParser" />
</property>
</bean>
The ManualParser is the default and most efficient. It is not directly based on the XDI ABNF. The APGParser and AParseParser are based on the XDI ABNF and are less efficient, but may be more correct and useful for debugging purposes.
- XdiAbnf on the OASIS XDI TC wiki
This work is licensed under a Creative Commons Attribution 4.0 International License.