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; }
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; }
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; }
/** * 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; }
/** * Whether message history is enabled on this route. */ @XmlAttribute @Metadata(defaultValue = "true") public void setMessageHistory(String messageHistory) { this.messageHistory = messageHistory; }
/** * Whether to auto start this route */ @XmlAttribute @Metadata(defaultValue = "true") public void setAutoStartup(String autoStartup) { this.autoStartup = autoStartup; }
/** * To control how to shutdown the route. */ @XmlAttribute @Metadata(defaultValue = "Default") public void setShutdownRoute(ShutdownRoute shutdownRoute) { this.shutdownRoute = shutdownRoute; }
/** * To control how to shutdown the route. */ @XmlAttribute @Metadata(defaultValue = "CompleteCurrentTaskOnly") public void setShutdownRunningTask(ShutdownRunningTask shutdownRunningTask) { this.shutdownRunningTask = shutdownRunningTask; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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."); }
/** * 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."); }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * To configure security using SSLContextParameters */ @Metadata(description = "To configure security using SSLContextParameters") public void setSslContextParameters(SSLContextParameters sslContextParameters) { this.sslContextParameters = sslContextParameters; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }