View Javadoc

1   /*
2    * $Id: OrphanAddressDefinitionParser.java 20321 2010-11-24 15:21:24Z dfeist $
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.OrphanDefinitionParser;
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 OrphanAddressDefinitionParser extends OrphanDefinitionParser
21  {
22  
23      public static final boolean META = true;
24      public static final boolean PROTOCOL = false;
25  
26      public OrphanAddressDefinitionParser(String metaOrProtocol, boolean isMeta)
27      {
28          super(URIBuilder.class, true);
29          registerPreProcessor(
30                  new AddAttribute(
31                          isMeta ? URIBuilder.META : URIBuilder.PROTOCOL,
32                          metaOrProtocol));
33      }
34  
35  }