Java 类org.apache.camel.spi.Metadata 实例源码

项目:Camel    文件:EipAnnotationProcessor.java   
private String findDefaultValue(VariableElement fieldElement, String fieldTypeName) {
    String defaultValue = null;
    Metadata metadata = fieldElement.getAnnotation(Metadata.class);
    if (metadata != null) {
        if (!Strings.isNullOrEmpty(metadata.defaultValue())) {
            defaultValue = metadata.defaultValue();
        }
    }
    if (defaultValue == null) {
        // if its a boolean type, then we use false as the default
        if ("boolean".equals(fieldTypeName) || "java.lang.Boolean".equals(fieldTypeName)) {
            defaultValue = "false";
        }
    }

    return defaultValue;
}
项目:Camel    文件:EipAnnotationProcessor.java   
protected EipModel findEipModelProperties(RoundEnvironment roundEnv, TypeElement classElement, String javaTypeName, String name) {
    EipModel model = new EipModel();
    model.setJavaType(javaTypeName);
    model.setName(name);

    Metadata metadata = classElement.getAnnotation(Metadata.class);
    if (metadata != null) {
        if (!Strings.isNullOrEmpty(metadata.label())) {
            model.setLabel(metadata.label());
        }
        if (!Strings.isNullOrEmpty(metadata.title())) {
            model.setTitle(metadata.title());
        }
    }

    // favor to use class javadoc of component as description
    if (model.getJavaType() != null) {
        Elements elementUtils = processingEnv.getElementUtils();
        TypeElement typeElement = findTypeElement(roundEnv, model.getJavaType());
        if (typeElement != null) {
            String doc = elementUtils.getDocComment(typeElement);
            if (doc != null) {
                // need to sanitize the description first (we only want a summary)
                doc = sanitizeDescription(doc, true);
                // the javadoc may actually be empty, so only change the doc if we got something
                if (!Strings.isNullOrEmpty(doc)) {
                    model.setDescription(doc);
                }
            }
        }
    }

    return model;
}
项目:Camel    文件:EipAnnotationProcessor.java   
private boolean findRequired(VariableElement fieldElement, boolean defaultValue) {
    Metadata metadata = fieldElement.getAnnotation(Metadata.class);
    if (metadata != null) {
        if (!Strings.isNullOrEmpty(metadata.required())) {
            defaultValue = "true".equals(metadata.required());
        }
    }
    return defaultValue;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * Allows to set a timeout in millis when using Jetty as consumer (server).
 * By default Jetty uses 30000. You can use a value of <= 0 to never expire.
 * If a timeout occurs then the request will be expired and Jetty will return back a http error 503 to the client.
 * This option is only in use when using Jetty with the Asynchronous Routing Engine.
 */
@Metadata(description = "Allows to set a timeout in millis when using Jetty as consumer (server)."
        + " By default Jetty uses 30000. You can use a value of <= 0 to never expire."
        + " If a timeout occurs then the request will be expired and Jetty will return back a http error 503 to the client."
        + " This option is only in use when using Jetty with the Asynchronous Routing Engine.")
public void setContinuationTimeout(Long continuationTimeout) {
    this.continuationTimeout = continuationTimeout;
}
项目:Camel    文件:RouteDefinition.java   
/**
 * Whether message history is enabled on this route.
 */
@XmlAttribute @Metadata(defaultValue = "true")
public void setMessageHistory(String messageHistory) {
    this.messageHistory = messageHistory;
}
项目:Camel    文件:RouteDefinition.java   
/**
 * Whether to auto start this route
 */
@XmlAttribute @Metadata(defaultValue = "true")
public void setAutoStartup(String autoStartup) {
    this.autoStartup = autoStartup;
}
项目:Camel    文件:RouteDefinition.java   
/**
 * To control how to shutdown the route.
 */
@XmlAttribute @Metadata(defaultValue = "Default")
public void setShutdownRoute(ShutdownRoute shutdownRoute) {
    this.shutdownRoute = shutdownRoute;
}
项目:Camel    文件:RouteDefinition.java   
/**
 * To control how to shutdown the route.
 */
@XmlAttribute @Metadata(defaultValue = "CompleteCurrentTaskOnly")
public void setShutdownRunningTask(ShutdownRunningTask shutdownRunningTask) {
    this.shutdownRunningTask = shutdownRunningTask;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * The key password, which is used to access the certificate's key entry in the keystore (this is the same password that is supplied to the keystore command's -keypass option).
 */
@Metadata(description = "The key password, which is used to access the certificate's key entry in the keystore "
        + "(this is the same password that is supplied to the keystore command's -keypass option).")
public void setSslKeyPassword(String sslKeyPassword) {
    this.sslKeyPassword = sslKeyPassword;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * The ssl password, which is required to access the keystore file (this is the same password that is supplied to the keystore command's -storepass option).
 */
@Metadata(description = "The ssl password, which is required to access the keystore file (this is the same password that is supplied to the keystore command's -storepass option).")
public void setSslPassword(String sslPassword) {
    this.sslPassword = sslPassword;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * Specifies the location of the Java keystore file, which contains the Jetty server's own X.509 certificate in a key entry.
 */
@Metadata(description = "Specifies the location of the Java keystore file, which contains the Jetty server's own X.509 certificate in a key entry.")
public void setKeystore(String sslKeystore) {
    this.sslKeystore = sslKeystore;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * This option is used to set the ErrorHandler that Jetty server uses.
 */
@Metadata(description = "This option is used to set the ErrorHandler that Jetty server uses.")
public void setErrorHandler(ErrorHandler errorHandler) {
    this.errorHandler = errorHandler;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * A map which contains per port number specific SSL connectors.
 */
@Metadata(description = "A map which contains per port number specific SSL connectors.")
public void setSslSocketConnectors(Map <Integer, Connector> connectors) {
    sslSocketConnectors = connectors;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * A map which contains per port number specific HTTP connectors. Uses the same principle as sslSocketConnectors.
 */
@Metadata(description = "A map which contains per port number specific HTTP connectors. Uses the same principle as sslSocketConnectors.")
public void setSocketConnectors(Map<Integer, Connector> socketConnectors) {
    this.socketConnectors = socketConnectors;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * To set a value for minimum number of threads in HttpClient thread pool. Notice that both a min and max size must be configured.
 */
@Metadata(description = "To set a value for minimum number of threads in HttpClient thread pool. Notice that both a min and max size must be configured.")
public void setHttpClientMinThreads(Integer httpClientMinThreads) {
    this.httpClientMinThreads = httpClientMinThreads;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * To set a value for maximum number of threads in HttpClient thread pool. Notice that both a min and max size must be configured.
 */
@Metadata(description = "To set a value for maximum number of threads in HttpClient thread pool. Notice that both a min and max size must be configured.")
public void setHttpClientMaxThreads(Integer httpClientMaxThreads) {
    this.httpClientMaxThreads = httpClientMaxThreads;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * To set a value for minimum number of threads in server thread pool. Notice that both a min and max size must be configured.
 */
@Metadata(description = "To set a value for minimum number of threads in server thread pool. Notice that both a min and max size must be configured.")
public void setMinThreads(Integer minThreads) {
    this.minThreads = minThreads;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * To set a value for maximum number of threads in server thread pool. Notice that both a min and max size must be configured.
 */
@Metadata(description = "To set a value for maximum number of threads in server thread pool. Notice that both a min and max size must be configured.")
public void setMaxThreads(Integer maxThreads) {
    this.maxThreads = maxThreads;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * To use a custom thread pool for the server. This option should only be used in special circumstances.
 */
@Metadata(description = "To use a custom thread pool for the server. This option should only be used in special circumstances.")
public void setThreadPool(ThreadPool threadPool) {
    this.threadPool = threadPool;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * If this option is true, Jetty JMX support will be enabled for this endpoint.
 */
@Metadata(description = "If this option is true, Jetty JMX support will be enabled for this endpoint.")
public void setEnableJmx(boolean enableJmx) {
    this.enableJmx = enableJmx;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * To use a custom org.apache.camel.component.jetty.JettyHttpBinding, which are used to customize how a response should be written for the producer.
 */
@Metadata(description = "To use a custom org.apache.camel.component.jetty.JettyHttpBinding, which are used to customize how a response should be written for the producer.")
public void setJettyHttpBinding(JettyHttpBinding jettyHttpBinding) {
    this.jettyHttpBinding = jettyHttpBinding;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * Not to be used - use JettyHttpBinding instead.
 */
@Override
@Metadata(description = "Not to be used - use JettyHttpBinding instead.")
public void setHttpBinding(HttpBinding httpBinding) {
    throw new IllegalArgumentException("Not to be used - use JettyHttpBinding instead.");
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * Jetty component does not use HttpConfiguration.
 */
@Override
@Metadata(description = "Jetty component does not use HttpConfiguration.")
public void setHttpConfiguration(HttpConfiguration httpConfiguration) {
    throw new IllegalArgumentException("Jetty component does not use HttpConfiguration.");
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * To use a existing configured org.eclipse.jetty.jmx.MBeanContainer if JMX is enabled that Jetty uses for registering mbeans.
 */
@Metadata(description = "To use a existing configured org.eclipse.jetty.jmx.MBeanContainer if JMX is enabled that Jetty uses for registering mbeans.")
public void setMbContainer(MBeanContainer mbContainer) {
    this.mbContainer = mbContainer;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * A map which contains general SSL connector properties.
 */
@Metadata(description = "A map which contains general SSL connector properties.")
public void setSslSocketConnectorProperties(Map<String, Object> sslSocketConnectorProperties) {
    this.sslSocketConnectorProperties = sslSocketConnectorProperties;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * A map which contains general HTTP connector properties. Uses the same principle as sslSocketConnectorProperties.
 */
@Metadata(description = "A map which contains general HTTP connector properties. Uses the same principle as sslSocketConnectorProperties.")
public void setSocketConnectorProperties(Map<String, Object> socketConnectorProperties) {
    this.socketConnectorProperties = socketConnectorProperties;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * Whether or not to use Jetty continuations for the Jetty Server.
 */
@Metadata(description = "Whether or not to use Jetty continuations for the Jetty Server.")
public void setUseContinuation(boolean useContinuation) {
    this.useContinuation = useContinuation;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * To configure security using SSLContextParameters
 */
@Metadata(description = "To configure security using SSLContextParameters")
public void setSslContextParameters(SSLContextParameters sslContextParameters) {
    this.sslContextParameters = sslContextParameters;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * Allows to configure a custom value of the response buffer size on the Jetty connectors.
 */
@Metadata(description = "Allows to configure a custom value of the response buffer size on the Jetty connectors.")
public void setResponseBufferSize(Integer responseBufferSize) {
    this.responseBufferSize = responseBufferSize;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * Allows to configure a custom value of the request buffer size on the Jetty connectors.
 */
@Metadata(description = "Allows to configure a custom value of the request buffer size on the Jetty connectors.")
public void setRequestBufferSize(Integer requestBufferSize) {
    this.requestBufferSize = requestBufferSize;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * Allows to configure a custom value of the request header size on the Jetty connectors.
 */
@Metadata(description = "Allows to configure a custom value of the request header size on the Jetty connectors.")
public void setRequestHeaderSize(Integer requestHeaderSize) {
    this.requestHeaderSize = requestHeaderSize;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * Allows to configure a custom value of the response header size on the Jetty connectors.
 */
@Metadata(description = "Allows to configure a custom value of the response header size on the Jetty connectors.")
public void setResponseHeaderSize(Integer responseHeaderSize) {
    this.responseHeaderSize = responseHeaderSize;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * To use a http proxy to configure the hostname.
 */
@Metadata(description = "To use a http proxy to configure the hostname.")
public void setProxyHost(String proxyHost) {
    this.proxyHost = proxyHost;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * To use a http proxy to configure the port number.
 */
@Metadata(description = "To use a http proxy to configure the port number.")
public void setProxyPort(Integer proxyPort) {
    this.proxyPort = proxyPort;
}
项目:Camel    文件:JettyHttpComponent.java   
/**
 * If the option is true, jetty will send the server header with the jetty version information to the client which sends the request.
 * NOTE please make sure there is no any other camel-jetty endpoint is share the same port, otherwise this option may not work as expected.
 */
@Metadata(description = "If the option is true, jetty server will send the date header to the client which sends the request."
        + " NOTE please make sure there is no any other camel-jetty endpoint is share the same port, otherwise this option may not work as expected.")
public void setSendServerVersion(boolean sendServerVersion) {
    this.sendServerVersion = sendServerVersion;
}