Package org.apache.camel.model

Examples of org.apache.camel.model.DescriptionDefinition


    public DescriptionDefinition getDescription() {
        return route.getDescription();
    }

    public String getDescriptionText() {
        DescriptionDefinition definition = getDescription();
        return (definition != null) ? definition.getText() : "";
    }
View Full Code Here


        };
    }

    @Converter
    public DescriptionDefinition toDefinition(String descriptionText) {
        DescriptionDefinition answer = new DescriptionDefinition();
        answer.setText(descriptionText);
        return answer;
    }
View Full Code Here

  }

  public static void setDescription(FromDefinition node, Endpoint endpoint) {
    String value = endpoint.getId();
    if (value != null && value.trim().length()>0) {
      DescriptionDefinition dd = new DescriptionDefinition();
      dd.setText(endpoint.getDescription());
      node.setDescription(dd);
    }
  }
View Full Code Here

      } else {
        processor.setInheritErrorHandler(null);
      }
    }
    if (description != null && description.trim().length() > 0) {
      DescriptionDefinition descriptionDefinition = new DescriptionDefinition();
      descriptionDefinition.setText(description);
      processor.setDescription(descriptionDefinition);
    }
    if (id != null && id.trim().length() > 0) {
      processor.setId(id);
      resetCustomId(processor);
View Full Code Here

    public void testCommentsBeforeRoutePreserved() throws Exception {
        XmlModel x = assertRoundTrip("src/test/resources/commentBeforeRoute.xml", 2);

        RouteDefinition route1 = x.getRouteDefinitionList().get(1);
        assertEquals("route4", route1.getId());
        DescriptionDefinition desc = route1.getDescription();
        assertNotNull(desc);
        assertEquals("route4 description\ncomment about route4", desc.getText());
    }
View Full Code Here

    @Test
    public void testCommentsInRoutePreserved() throws Exception {
        XmlModel x = assertRoundTrip("src/test/resources/commentInRoute.xml", 1);

        RouteDefinition route1 = x.getRouteDefinitionList().get(0);
        DescriptionDefinition desc = route1.getDescription();
        assertNotNull(desc);
        assertEquals("route3 comment", desc.getText());
    }
View Full Code Here

    @Test
    public void testCommentsInRouteWithDescriptionPreserved() throws Exception {
        XmlModel x = assertRoundTrip("src/test/resources/commentInRouteWithDescription.xml", 1);

        RouteDefinition route1 = x.getRouteDefinitionList().get(0);
        DescriptionDefinition desc = route1.getDescription();
        assertNotNull(desc);
        assertEquals("previous description\nnew comment added to previous one", desc.getText());
    }
View Full Code Here

        };
    }

    @Converter
    public DescriptionDefinition toDefinition(String descriptionText) {
        DescriptionDefinition answer = new DescriptionDefinition();
        answer.setText(descriptionText);
        return answer;
    }
View Full Code Here

    public DescriptionDefinition getDescription() {
        return route.getDescription();
    }

    public String getDescriptionText() {
        DescriptionDefinition definition = getDescription();
        return (definition != null) ? definition.getText() : "";
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.model.DescriptionDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.