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