View Javadoc

1   /*
2    * $Id:ChildAddressDefinitionParser.java 8321 2007-09-10 19:22:52Z acooke $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.config.spring.parsers.specific.endpoint.support;
12  
13  import org.mule.config.spring.parsers.generic.ChildDefinitionParser;
14  import org.mule.config.spring.parsers.processors.AddAttribute;
15  import org.mule.endpoint.URIBuilder;
16  
17  /**
18   * Generate an Endpoint URI from simple address components.
19   */
20  public class ChildAddressDefinitionParser extends ChildDefinitionParser
21  {
22  
23      public static final boolean META = true;
24      public static final boolean PROTOCOL = false;
25  
26      public ChildAddressDefinitionParser(String protocol)
27      {
28          this(protocol, PROTOCOL);
29      }
30  
31      public ChildAddressDefinitionParser(String metaOrProtocol, boolean isMeta)
32      {
33          super(EndpointUtils.URI_BUILDER_ATTRIBUTE, URIBuilder.class);
34          registerPreProcessor(
35                  new AddAttribute(
36                          isMeta ? URIBuilder.META : URIBuilder.PROTOCOL,
37                          metaOrProtocol));
38      }
39  
40  }