1 package com.terradue.jcatalogue.client.internal.digester;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import org.apache.commons.digester3.binder.AbstractNamespaceURIBasedRulesModule;
20
21 import com.terradue.jcatalogue.client.CatalogueDescription;
22
23 public final class OpenSearchModule
24 extends AbstractNamespaceURIBasedRulesModule
25 {
26
27 public OpenSearchModule()
28 {
29 super( "http://a9.com/-/spec/opensearch/1.1/" );
30 }
31
32 @Override
33 protected void configure()
34 {
35 forPattern( "OpenSearchDescription" ).createObject().ofType( CatalogueDescription.class );
36 forPattern( "OpenSearchDescription/ShortName" ).setBeanProperty().withName( "shortName" );
37 forPattern( "OpenSearchDescription/LongName" ).setBeanProperty().withName( "longName" );
38 forPattern( "OpenSearchDescription/Description" ).setBeanProperty().withName( "description" );
39 forPattern( "OpenSearchDescription/Tags" ).setBeanProperty().withName( "tags" );
40 forPattern( "OpenSearchDescription/ShortName" ).setBeanProperty().withName( "shortName" );
41 forPattern( "OpenSearchDescription/Contact" ).setBeanProperty().withName( "contact" );
42 forPattern( "OpenSearchDescription/Developer" ).setBeanProperty().withName( "developer" );
43 forPattern( "OpenSearchDescription/Attribution" ).setBeanProperty().withName( "attribution" );
44 forPattern( "OpenSearchDescription/SyndicationRight" ).setBeanProperty().withName( "syndicationRight" );
45 forPattern( "OpenSearchDescription/AdultContent" ).setBeanProperty().withName( "adultContent" );
46 forPattern( "OpenSearchDescription/Language" ).setBeanProperty().withName( "language" );
47 forPattern( "OpenSearchDescription/InputEncoding" ).setBeanProperty().withName( "inputEncoding" );
48 forPattern( "OpenSearchDescription/OutputEncoding" ).setBeanProperty().withName( "outputEncoding" );
49
50 forPattern( "OpenSearchDescription/Url" )
51 .factoryCreate()
52 .usingFactory( new OpenSearchUrlCreationFactory() )
53 .then()
54 .setNext( "addOpenSearchUrl" );
55 }
56
57 }