AFAIK the only way to do programmatic Java class mapping configuration is to generate XML on the fly then pass it to Compass using, for example
configuration.addInputStream(is, name)
This works but feels a little clunky, and apart from other things means a dependency (for me) on XML tools (yuck!) and the XML config schema.
A neater solution would be for Compass to provide a runtime mapping API so I can work directly with that in Java.
Description
AFAIK the only way to do programmatic Java class mapping configuration is to generate XML on the fly then pass it to Compass using, for example
configuration.addInputStream(is, name)
This works but feels a little clunky, and apart from other things means a dependency (for me) on XML tools (yuck!) and the XML config schema.
A neater solution would be for Compass to provide a runtime mapping API so I can work directly with that in Java.
Added the ability to call CompassConfiguration#addResourceMapping(ResourceMapping). Resource Mapping is a super interface for all different mappings supported by Compass, such as ClassMapping.
In order to understand how it can be used, I suggest looking at: XmlMappingBinding or AnnotationsMappingBinding. This is, at least, until I get a chance to update it in the reference documentation.
Shay Banon added a comment - 01/May/07 03:47 PM Added the ability to call CompassConfiguration#addResourceMapping(ResourceMapping). Resource Mapping is a super interface for all different mappings supported by Compass, such as ClassMapping.
In order to understand how it can be used, I suggest looking at: XmlMappingBinding or AnnotationsMappingBinding. This is, at least, until I get a chance to update it in the reference documentation.
In order to understand how it can be used, I suggest looking at: XmlMappingBinding or AnnotationsMappingBinding. This is, at least, until I get a chance to update it in the reference documentation.