本文整理汇总了Java中org.apache.camel.catalog.CamelCatalog类的典型用法代码示例。如果您正苦于以下问题:Java CamelCatalog类的具体用法?Java CamelCatalog怎么用?Java CamelCatalog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CamelCatalog类属于org.apache.camel.catalog包,在下文中一共展示了CamelCatalog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: EditConnectorOptionsStep
import org.apache.camel.catalog.CamelCatalog; //导入依赖的package包/类
public EditConnectorOptionsStep(ProjectFactory projectFactory,
CamelCatalog camelCatalog,
String connectorName, String camelComponentName, String group,
List<InputComponent> allInputs,
List<InputComponent> inputs,
boolean last, int index, int total) {
this.projectFactory = projectFactory;
this.camelCatalog = camelCatalog;
this.connectorName = connectorName;
this.camelComponentName = camelComponentName;
this.group = group;
this.allInputs = allInputs;
this.inputs = inputs;
this.last = last;
// we want to 1-based
this.index = index + 1;
this.total = total;
}
开发者ID:fabric8io,项目名称:django,代码行数:19,代码来源:EditConnectorOptionsStep.java
示例2: apply
import org.apache.camel.catalog.CamelCatalog; //导入依赖的package包/类
@Override
public List<CompletionItem> apply(CamelCatalog catalog) {
Stream<EndpointOptionModel> endpointOptions = ModelHelper.generateComponentModel(catalog.componentJSonSchema(camelComponentName), true).getEndpointOptions().stream();
return endpointOptions
.filter(endpoint -> "parameter".equals(endpoint.getKind()))
.filter(endpoint -> {
String group = endpoint.getGroup();
if (isProducer) {
return !"consumer".equals(group);
} else {
return !"producer".equals(group);
}
})
.map(parameter -> {
CompletionItem completionItem = new CompletionItem(parameter.getName());
String insertText = parameter.getName() + "=";
if(parameter.getDefaultValue() != null) {
insertText += parameter.getDefaultValue();
}
completionItem.setInsertText(insertText);
return completionItem;
})
.collect(Collectors.toList());
}
开发者ID:lhein,项目名称:camel-language-server,代码行数:25,代码来源:CamelOptionSchemaCompletionsFuture.java
示例3: ConfigureComponentPropertiesStep
import org.apache.camel.catalog.CamelCatalog; //导入依赖的package包/类
public ConfigureComponentPropertiesStep(ProjectFactory projectFactory,
DependencyInstaller dependencyInstaller,
CamelCatalog camelCatalog,
String componentName, String group,
List<InputComponent> allInputs,
List<InputComponent> inputs,
boolean last, int index, int total) {
this.projectFactory = projectFactory;
this.dependencyInstaller = dependencyInstaller;
this.camelCatalog = camelCatalog;
this.componentName = componentName;
this.group = group;
this.allInputs = allInputs;
this.inputs = inputs;
this.last = last;
// we want to 1-based
this.index = index + 1;
this.total = total;
}
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:20,代码来源:ConfigureComponentPropertiesStep.java
示例4: componentsFromArtifact
import org.apache.camel.catalog.CamelCatalog; //导入依赖的package包/类
public static Set<String> componentsFromArtifact(CamelCatalog camelCatalog, String artifactId) {
Set<String> answer = new TreeSet<String>();
// use the camel catalog to find what components the artifact has
for (String name : camelCatalog.findComponentNames()) {
String json = camelCatalog.componentJSonSchema(name);
if (json != null) {
List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("component", json, false);
String scheme = null;
String artifact = null;
for (Map<String, String> row : data) {
if (row.get("artifactId") != null) {
artifact = row.get("artifactId");
}
if (row.get("scheme") != null) {
scheme = row.get("scheme");
}
}
if (artifactId.equals(artifact) && scheme != null) {
answer.add(scheme);
}
}
}
return answer;
}
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:27,代码来源:CamelCatalogHelper.java
示例5: dataFormatsFromArtifact
import org.apache.camel.catalog.CamelCatalog; //导入依赖的package包/类
public static Set<String> dataFormatsFromArtifact(CamelCatalog camelCatalog, String artifactId) {
Set<String> answer = new TreeSet<String>();
// use the camel catalog to find what components the artifact has
for (String name : camelCatalog.findDataFormatNames()) {
String json = camelCatalog.dataFormatJSonSchema(name);
if (json != null) {
List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("dataformat", json, false);
String df = null;
String artifact = null;
for (Map<String, String> row : data) {
if (row.get("artifactId") != null) {
artifact = row.get("artifactId");
}
if (row.get("name") != null) {
df = row.get("name");
}
}
if (artifactId.equals(artifact) && df != null) {
answer.add(df);
}
}
}
return answer;
}
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:27,代码来源:CamelCatalogHelper.java
示例6: languagesFromArtifact
import org.apache.camel.catalog.CamelCatalog; //导入依赖的package包/类
public static Set<String> languagesFromArtifact(CamelCatalog camelCatalog, String artifactId) {
Set<String> answer = new TreeSet<String>();
// use the camel catalog to find what components the artifact has
for (String name : camelCatalog.findLanguageNames()) {
String json = camelCatalog.languageJSonSchema(name);
if (json != null) {
List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("language", json, false);
String lan = null;
String artifact = null;
for (Map<String, String> row : data) {
if (row.get("artifactId") != null) {
artifact = row.get("artifactId");
}
if (row.get("name") != null) {
lan = row.get("name");
}
}
if (artifactId.equals(artifact) && lan != null) {
answer.add(lan);
}
}
}
return answer;
}
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:27,代码来源:CamelCatalogHelper.java
示例7: isDefaultValue
import org.apache.camel.catalog.CamelCatalog; //导入依赖的package包/类
/**
* Checks whether the given value is matching the default value from the given component.
*
* @param scheme the component name
* @param key the option key
* @param value the option value
* @return <tt>true</tt> if matching the default value, <tt>false</tt> otherwise
*/
public static boolean isDefaultValue(CamelCatalog camelCatalog, String scheme, String key, String value) {
// use the camel catalog
String json = camelCatalog.componentJSonSchema(scheme);
if (json == null) {
throw new IllegalArgumentException("Could not find catalog entry for component name: " + scheme);
}
List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("properties", json, true);
if (data != null) {
for (Map<String, String> propertyMap : data) {
String name = propertyMap.get("name");
String defaultValue = propertyMap.get("defaultValue");
if (key.equals(name)) {
return value.equalsIgnoreCase(defaultValue);
}
}
}
return false;
}
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:28,代码来源:CamelCatalogHelper.java
示例8: isDefaultValueComponent
import org.apache.camel.catalog.CamelCatalog; //导入依赖的package包/类
/**
* Checks whether the given value is matching the default value from the given component.
*
* @param scheme the component name
* @param key the option key
* @param value the option value
* @return <tt>true</tt> if matching the default value, <tt>false</tt> otherwise
*/
public static boolean isDefaultValueComponent(CamelCatalog camelCatalog, String scheme, String key, String value) {
// use the camel catalog
String json = camelCatalog.componentJSonSchema(scheme);
if (json == null) {
throw new IllegalArgumentException("Could not find catalog entry for component name: " + scheme);
}
List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("componentProperties", json, true);
if (data != null) {
for (Map<String, String> propertyMap : data) {
String name = propertyMap.get("name");
String defaultValue = propertyMap.get("defaultValue");
if (key.equals(name)) {
return value.equalsIgnoreCase(defaultValue);
}
}
}
return false;
}
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:28,代码来源:CamelCatalogHelper.java
示例9: isMultiValue
import org.apache.camel.catalog.CamelCatalog; //导入依赖的package包/类
/**
* Checks whether the given key is a multi valued option
*
* @param scheme the component name
* @param key the option key
* @return <tt>true</tt> if the key is multi valued, <tt>false</tt> otherwise
*/
public static boolean isMultiValue(CamelCatalog camelCatalog, String scheme, String key) {
// use the camel catalog
String json = camelCatalog.componentJSonSchema(scheme);
if (json == null) {
throw new IllegalArgumentException("Could not find catalog entry for component name: " + scheme);
}
List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("properties", json, true);
if (data != null) {
for (Map<String, String> propertyMap : data) {
String name = propertyMap.get("name");
String multiValue = propertyMap.get("multiValue");
if (key.equals(name)) {
return "true".equals(multiValue);
}
}
}
return false;
}
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:27,代码来源:CamelCatalogHelper.java
示例10: getPrefix
import org.apache.camel.catalog.CamelCatalog; //导入依赖的package包/类
/**
* Checks whether the given key is a multi valued option
*
* @param scheme the component name
* @param key the option key
* @return <tt>true</tt> if the key is multi valued, <tt>false</tt> otherwise
*/
public static String getPrefix(CamelCatalog camelCatalog, String scheme, String key) {
// use the camel catalog
String json = camelCatalog.componentJSonSchema(scheme);
if (json == null) {
throw new IllegalArgumentException("Could not find catalog entry for component name: " + scheme);
}
List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("properties", json, true);
if (data != null) {
for (Map<String, String> propertyMap : data) {
String name = propertyMap.get("name");
String prefix = propertyMap.get("prefix");
if (key.equals(name)) {
return prefix;
}
}
}
return null;
}
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:27,代码来源:CamelCatalogHelper.java
示例11: isNonePlaceholderEnumValue
import org.apache.camel.catalog.CamelCatalog; //导入依赖的package包/类
/**
* Checks whether the given value corresponds to a dummy none placeholder for an enum type
*
* @param scheme the component name
* @param key the option key
* @return <tt>true</tt> if matching the default value, <tt>false</tt> otherwise
*/
public static boolean isNonePlaceholderEnumValue(CamelCatalog camelCatalog, String scheme, String key) {
// use the camel catalog
String json = camelCatalog.componentJSonSchema(scheme);
if (json == null) {
throw new IllegalArgumentException("Could not find catalog entry for component name: " + scheme);
}
List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("properties", json, true);
if (data != null) {
for (Map<String, String> propertyMap : data) {
String name = propertyMap.get("name");
String enums = propertyMap.get("enum");
if (key.equals(name) && enums != null) {
if (!enums.contains("none")) {
return true;
} else {
return false;
}
}
}
}
return false;
}
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:31,代码来源:CamelCatalogHelper.java
示例12: isNonePlaceholderEnumValueComponent
import org.apache.camel.catalog.CamelCatalog; //导入依赖的package包/类
/**
* Checks whether the given value corresponds to a dummy none placeholder for an enum type
*
* @param scheme the component name
* @param key the option key
* @return <tt>true</tt> if matching the default value, <tt>false</tt> otherwise
*/
public static boolean isNonePlaceholderEnumValueComponent(CamelCatalog camelCatalog, String scheme, String key) {
// use the camel catalog
String json = camelCatalog.componentJSonSchema(scheme);
if (json == null) {
throw new IllegalArgumentException("Could not find catalog entry for component name: " + scheme);
}
List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("componentProperties", json, true);
if (data != null) {
for (Map<String, String> propertyMap : data) {
String name = propertyMap.get("name");
String enums = propertyMap.get("enum");
if (key.equals(name) && enums != null) {
if (!enums.contains("none")) {
return true;
} else {
return false;
}
}
}
}
return false;
}
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:31,代码来源:CamelCatalogHelper.java
示例13: getEnumJavaTypeComponent
import org.apache.camel.catalog.CamelCatalog; //导入依赖的package包/类
/**
* Get's the java type for the given option if its enum based, otherwise it returns null
*
* @param scheme the component name
* @param key the option key
* @return <tt>true</tt> if matching the default value, <tt>false</tt> otherwise
*/
public static String getEnumJavaTypeComponent(CamelCatalog camelCatalog, String scheme, String key) {
// use the camel catalog
String json = camelCatalog.componentJSonSchema(scheme);
if (json == null) {
throw new IllegalArgumentException("Could not find catalog entry for component name: " + scheme);
}
List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("componentProperties", json, true);
if (data != null) {
for (Map<String, String> propertyMap : data) {
String javaType = propertyMap.get("javaType");
String name = propertyMap.get("name");
String enums = propertyMap.get("enum");
if (key.equals(name) && enums != null) {
return javaType;
}
}
}
return null;
}
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:28,代码来源:CamelCatalogHelper.java
示例14: isModelDefaultValue
import org.apache.camel.catalog.CamelCatalog; //导入依赖的package包/类
/**
* Checks whether the given value is matching the default value from the given model.
*
* @param modelName the model name
* @param key the option key
* @param value the option value
* @return <tt>true</tt> if matching the default value, <tt>false</tt> otherwise
*/
public static boolean isModelDefaultValue(CamelCatalog camelCatalog, String modelName, String key, String value) {
// use the camel catalog
String json = camelCatalog.modelJSonSchema(modelName);
if (json == null) {
throw new IllegalArgumentException("Could not find catalog entry for model name: " + modelName);
}
List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("properties", json, true);
if (data != null) {
for (Map<String, String> propertyMap : data) {
String name = propertyMap.get("name");
String defaultValue = propertyMap.get("defaultValue");
if (key.equals(name)) {
return value.equalsIgnoreCase(defaultValue);
}
}
}
return false;
}
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:28,代码来源:CamelCatalogHelper.java
示例15: isModelExpressionKind
import org.apache.camel.catalog.CamelCatalog; //导入依赖的package包/类
/**
* Checks whether the given key is an expression kind
*
* @param modelName the model name
* @param key the option key
* @return <tt>true</tt> if the key is an expression type, <tt>false</tt> otherwise
*/
public static boolean isModelExpressionKind(CamelCatalog camelCatalog, String modelName, String key) {
// use the camel catalog
String json = camelCatalog.modelJSonSchema(modelName);
if (json == null) {
throw new IllegalArgumentException("Could not find catalog entry for model name: " + modelName);
}
List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("properties", json, true);
if (data != null) {
for (Map<String, String> propertyMap : data) {
String name = propertyMap.get("name");
if (key.equals(name)) {
return "expression".equals(propertyMap.get("kind"));
}
}
}
return false;
}
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:26,代码来源:CamelCatalogHelper.java
示例16: getModelJavaType
import org.apache.camel.catalog.CamelCatalog; //导入依赖的package包/类
/**
* Gets the java type of the given model
*
* @param modelName the model name
* @return the java type
*/
public static String getModelJavaType(CamelCatalog camelCatalog, String modelName) {
// use the camel catalog
String json = camelCatalog.modelJSonSchema(modelName);
if (json == null) {
throw new IllegalArgumentException("Could not find catalog entry for model name: " + modelName);
}
List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("model", json, false);
if (data != null) {
for (Map<String, String> propertyMap : data) {
String javaType = propertyMap.get("javaType");
if (javaType != null) {
return javaType;
}
}
}
return null;
}
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:25,代码来源:CamelCatalogHelper.java
示例17: isModelSupportOutput
import org.apache.camel.catalog.CamelCatalog; //导入依赖的package包/类
/**
* Whether the EIP supports outputs
*
* @param modelName the model name
* @return <tt>true</tt> if output supported, <tt>false</tt> otherwise
*/
public static boolean isModelSupportOutput(CamelCatalog camelCatalog, String modelName) {
// use the camel catalog
String json = camelCatalog.modelJSonSchema(modelName);
if (json == null) {
throw new IllegalArgumentException("Could not find catalog entry for model name: " + modelName);
}
List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("model", json, false);
if (data != null) {
for (Map<String, String> propertyMap : data) {
String output = propertyMap.get("output");
if (output != null) {
return "true".equals(output);
}
}
}
return false;
}
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:25,代码来源:CamelCatalogHelper.java
示例18: isComponentConsumerOnly
import org.apache.camel.catalog.CamelCatalog; //导入依赖的package包/类
/**
* Whether the component is consumer only
*/
public static boolean isComponentConsumerOnly(CamelCatalog camelCatalog, String scheme) {
// use the camel catalog
String json = camelCatalog.componentJSonSchema(scheme);
if (json == null) {
return false;
}
List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("component", json, false);
if (data != null) {
for (Map<String, String> propertyMap : data) {
String consumerOnly = propertyMap.get("consumerOnly");
if (consumerOnly != null) {
return true;
}
}
}
return false;
}
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:22,代码来源:CamelCatalogHelper.java
示例19: isComponentProducerOnly
import org.apache.camel.catalog.CamelCatalog; //导入依赖的package包/类
/**
* Whether the component is consumer only
*/
public static boolean isComponentProducerOnly(CamelCatalog camelCatalog, String scheme) {
// use the camel catalog
String json = camelCatalog.componentJSonSchema(scheme);
if (json == null) {
return false;
}
List<Map<String, String>> data = JSonSchemaHelper.parseJsonSchema("component", json, false);
if (data != null) {
for (Map<String, String> propertyMap : data) {
String consumerOnly = propertyMap.get("producerOnly");
if (consumerOnly != null) {
return true;
}
}
}
return false;
}
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:22,代码来源:CamelCatalogHelper.java
示例20: parseCamelContexts
import org.apache.camel.catalog.CamelCatalog; //导入依赖的package包/类
protected static List<ContextDto> parseCamelContexts(CamelCatalog camelCatalog, File xmlFile) throws Exception {
List<ContextDto> camelContexts = new ArrayList<>();
RouteXml routeXml = new RouteXml();
XmlModel xmlModel = routeXml.unmarshal(xmlFile);
// TODO we don't handle multiple contexts inside an XML file!
CamelContextFactoryBean contextElement = xmlModel.getContextElement();
String name = contextElement.getId();
List<RouteDefinition> routeDefs = contextElement.getRoutes();
ContextDto context = new ContextDto(name);
camelContexts.add(context);
String key = name;
if (Strings.isNullOrBlank(key)) {
key = "_camelContext" + camelContexts.size();
}
context.setKey(key);
List<NodeDto> routes = createRouteDtos(camelCatalog, routeDefs, context);
context.setChildren(routes);
return camelContexts;
}
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:22,代码来源:CamelXmlHelper.java
注:本文中的org.apache.camel.catalog.CamelCatalog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论