Skip to content
peacekeeper edited this page Nov 17, 2014 · 11 revisions

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.

Interfaces and Classes

Specifying a parser

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>

Considerations

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.

See also

Clone this wiki locally