idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
31,200 | private Process executeToAstProcess ( String argument ) throws IOException { try { Process p = new ProcessBuilder ( "python" , codeGenBinDirectory + "/jp-to-ast.py" , argument ) . start ( ) ; p . waitFor ( ) ; return p ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; throw new RuntimeException ( e ) ; } } | Execute the jp - to - ast . py command and wait for it to complete . |
31,201 | public void setProductCodes ( java . util . Collection < ProductCode > productCodes ) { if ( productCodes == null ) { this . productCodes = null ; return ; } this . productCodes = new java . util . ArrayList < ProductCode > ( productCodes ) ; } | The product code of the EC2 instance . |
31,202 | public AWSCredentials getCredentials ( String profileName ) { final AWSCredentialsProvider provider = credentialProviderCache . get ( profileName ) ; if ( provider != null ) { return provider . getCredentials ( ) ; } else { BasicProfile profile = allProfiles . getProfile ( profileName ) ; if ( profile == null ) { throw new IllegalArgumentException ( "No AWS profile named '" + profileName + "'" ) ; } final AWSCredentialsProvider newProvider = fromProfile ( profile ) ; credentialProviderCache . put ( profileName , newProvider ) ; return newProvider . getCredentials ( ) ; } } | Returns the AWS credentials for the specified profile . |
31,203 | public void setReservations ( java . util . Collection < Reservation > reservations ) { if ( reservations == null ) { this . reservations = null ; return ; } this . reservations = new java . util . ArrayList < Reservation > ( reservations ) ; } | List of reservations |
31,204 | public CreateTagsRequest withTags ( java . util . Map < String , String > tags ) { setTags ( tags ) ; return this ; } | The key - value pair for the resource tag . |
31,205 | private String getTextField ( JsonNode json , String fieldName ) { if ( ! json . has ( fieldName ) ) { return null ; } return json . get ( fieldName ) . asText ( ) ; } | Get a String field from the JSON . |
31,206 | private Long getLongField ( JsonNode json , String fieldName ) { if ( ! json . has ( fieldName ) ) { return null ; } return json . get ( fieldName ) . longValue ( ) ; } | Get a Long field from the JSON . |
31,207 | private Integer getIntegerField ( JsonNode json , String fieldName ) { if ( ! json . has ( fieldName ) ) { return null ; } return json . get ( fieldName ) . intValue ( ) ; } | Get an Integer field from the JSON . |
31,208 | public void setDestinationSSECustomerKey ( SSECustomerKey sseKey ) { if ( sseKey != null && this . sseAwsKeyManagementParams != null ) { throw new IllegalArgumentException ( "Either SSECustomerKey or SSEAwsKeyManagementParams must not be set at the same time." ) ; } this . destinationSSECustomerKey = sseKey ; } | Sets the optional customer - provided server - side encryption key to use to encrypt the destination object being copied . |
31,209 | public CopyObjectRequest withMetadataDirective ( MetadataDirective metadataDirective ) { return withMetadataDirective ( metadataDirective == null ? null : metadataDirective . toString ( ) ) ; } | Specifies whether the metadata is copied from the source object or replaced with metadata provided in the request . |
31,210 | double bytesPerSecond ( double byteCount , double durationNano ) { if ( byteCount < 0 || durationNano < 0 ) throw new IllegalArgumentException ( ) ; if ( durationNano == 0 ) { durationNano = 1.0 ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Set zero to one to avoid division by zero; but should never get here!" ) ; } } double bytesPerSec = ( byteCount / durationNano ) * NANO_PER_SEC ; if ( bytesPerSec == 0 ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "zero bytes per sec. Really ?" ) ; } } return bytesPerSec ; } | Returns the number of bytes per second given the byte count and duration in nano seconds . Duration of zero nanosecond will be treated as 1 nanosecond . |
31,211 | public void setConnectivityInfo ( java . util . Collection < ConnectivityInfo > connectivityInfo ) { if ( connectivityInfo == null ) { this . connectivityInfo = null ; return ; } this . connectivityInfo = new java . util . ArrayList < ConnectivityInfo > ( connectivityInfo ) ; } | A list of connectivity info . |
31,212 | private static boolean expiring ( Date expiry ) { long timeRemaining = expiry . getTime ( ) - System . currentTimeMillis ( ) ; return timeRemaining < EXPIRY_TIME_MILLIS ; } | Session credentials that expire in less than a minute are considered expiring . |
31,213 | public RetryTemplateBuilder fixedBackoff ( long interval ) { Assert . isNull ( this . backOffPolicy , "You have already selected backoff policy" ) ; Assert . isTrue ( interval >= 1 , "Interval should be >= 1" ) ; FixedBackOffPolicy policy = new FixedBackOffPolicy ( ) ; policy . setBackOffPeriod ( interval ) ; this . backOffPolicy = policy ; return this ; } | Perform each retry after fixed amount of time . |
31,214 | protected Pointcut buildPointcut ( Set < Class < ? extends Annotation > > retryAnnotationTypes ) { ComposablePointcut result = null ; for ( Class < ? extends Annotation > retryAnnotationType : retryAnnotationTypes ) { Pointcut filter = new AnnotationClassOrMethodPointcut ( retryAnnotationType ) ; if ( result == null ) { result = new ComposablePointcut ( filter ) ; } else { result . union ( filter ) ; } } return result ; } | Calculate a pointcut for the given retry annotation types if any . |
31,215 | public void addSequence ( List < Long > sleeps ) { sleepHistogram . addAll ( sleeps ) ; sleepSequences . add ( new SleepSequence ( sleeps ) ) ; } | Add a sequence of sleeps to the simulation . |
31,216 | public RetryInterceptorBuilder < T > retryOperations ( RetryOperations retryOperations ) { Assert . isTrue ( ! this . templateAltered , "Cannot set retryOperations when the default has been modified" ) ; this . retryOperations = retryOperations ; return this ; } | Apply the retry operations - once this is set other properties can no longer be set ; can t be set if other properties have been applied . |
31,217 | public RetryInterceptorBuilder < T > maxAttempts ( int maxAttempts ) { Assert . isNull ( this . retryOperations , "cannot alter the retry policy when a custom retryOperations has been set" ) ; Assert . isTrue ( ! this . retryPolicySet , "cannot alter the retry policy when a custom retryPolicy has been set" ) ; this . simpleRetryPolicy . setMaxAttempts ( maxAttempts ) ; this . retryTemplate . setRetryPolicy ( this . simpleRetryPolicy ) ; this . templateAltered = true ; return this ; } | Apply the max attempts - a SimpleRetryPolicy will be used . Cannot be used if a custom retry operations or retry policy has been set . |
31,218 | public RetryInterceptorBuilder < T > backOffOptions ( long initialInterval , double multiplier , long maxInterval ) { Assert . isNull ( this . retryOperations , "cannot set the back off policy when a custom retryOperations has been set" ) ; Assert . isTrue ( ! this . backOffPolicySet , "cannot set the back off options when a back off policy has been set" ) ; ExponentialBackOffPolicy policy = new ExponentialBackOffPolicy ( ) ; policy . setInitialInterval ( initialInterval ) ; policy . setMultiplier ( multiplier ) ; policy . setMaxInterval ( maxInterval ) ; this . retryTemplate . setBackOffPolicy ( policy ) ; this . backOffOptionsSet = true ; this . templateAltered = true ; return this ; } | Apply the backoff options . Cannot be used if a custom retry operations or back off policy has been set . |
31,219 | public RetryInterceptorBuilder < T > retryPolicy ( RetryPolicy policy ) { Assert . isNull ( this . retryOperations , "cannot set the retry policy when a custom retryOperations has been set" ) ; Assert . isTrue ( ! this . templateAltered , "cannot set the retry policy if max attempts or back off policy or options changed" ) ; this . retryTemplate . setRetryPolicy ( policy ) ; this . retryPolicySet = true ; this . templateAltered = true ; return this ; } | Apply the retry policy - cannot be used if a custom retry template has been provided or the max attempts or back off options or policy have been applied . |
31,220 | public RetryInterceptorBuilder < T > backOffPolicy ( BackOffPolicy policy ) { Assert . isNull ( this . retryOperations , "cannot set the back off policy when a custom retryOperations has been set" ) ; Assert . isTrue ( ! this . backOffOptionsSet , "cannot set the back off policy when the back off policy options have been set" ) ; this . retryTemplate . setBackOffPolicy ( policy ) ; this . templateAltered = true ; this . backOffPolicySet = true ; return this ; } | Apply the back off policy . Cannot be used if a custom retry operations or back off policy has been applied . |
31,221 | public void setListeners ( Collection < RetryListener > globalListeners ) { ArrayList < RetryListener > retryListeners = new ArrayList < RetryListener > ( globalListeners ) ; AnnotationAwareOrderComparator . sort ( retryListeners ) ; this . globalListeners = retryListeners . toArray ( new RetryListener [ 0 ] ) ; } | Default retry listeners to apply to all operations . |
31,222 | private String resolve ( String value ) { if ( this . beanFactory != null && this . beanFactory instanceof ConfigurableBeanFactory ) { return ( ( ConfigurableBeanFactory ) this . beanFactory ) . resolveEmbeddedValue ( value ) ; } return value ; } | Resolve the specified value if possible . |
31,223 | public void registerListener ( RetryListener listener ) { List < RetryListener > list = new ArrayList < RetryListener > ( Arrays . asList ( this . listeners ) ) ; list . add ( listener ) ; this . listeners = list . toArray ( new RetryListener [ list . size ( ) ] ) ; } | Register an additional listener . |
31,224 | public final < T , E extends Throwable > T execute ( RetryCallback < T , E > retryCallback ) throws E { return doExecute ( retryCallback , null , null ) ; } | Keep executing the callback until it either succeeds or the policy dictates that we stop in which case the most recent exception thrown by the callback will be rethrown . |
31,225 | protected < T > T handleRetryExhausted ( RecoveryCallback < T > recoveryCallback , RetryContext context , RetryState state ) throws Throwable { context . setAttribute ( RetryContext . EXHAUSTED , true ) ; if ( state != null && ! context . hasAttribute ( GLOBAL_STATE ) ) { this . retryContextCache . remove ( state . getKey ( ) ) ; } if ( recoveryCallback != null ) { T recovered = recoveryCallback . recover ( context ) ; context . setAttribute ( RetryContext . RECOVERED , true ) ; return recovered ; } if ( state != null ) { this . logger . debug ( "Retry exhausted after last attempt with no recovery path." ) ; rethrow ( context , "Retry exhausted after last attempt with no recovery path" ) ; } throw wrapIfNecessary ( context . getLastThrowable ( ) ) ; } | Actions to take after final attempt has failed . If there is state clean up the cache . If there is a recovery callback execute that and return its result . Otherwise throw an exception . |
31,226 | public static String getParamTypesString ( Class < ? > ... paramTypes ) { StringBuilder paramTypesList = new StringBuilder ( "(" ) ; for ( int i = 0 ; i < paramTypes . length ; i ++ ) { paramTypesList . append ( paramTypes [ i ] . getSimpleName ( ) ) ; if ( i + 1 < paramTypes . length ) { paramTypesList . append ( ", " ) ; } } return paramTypesList . append ( ")" ) . toString ( ) ; } | Create a String representation of the array of parameter types . |
31,227 | public static MethodInvoker getMethodInvokerByAnnotation ( final Class < ? extends Annotation > annotationType , final Object target , final Class < ? > ... expectedParamTypes ) { MethodInvoker mi = MethodInvokerUtils . getMethodInvokerByAnnotation ( annotationType , target ) ; final Class < ? > targetClass = ( target instanceof Advised ) ? ( ( Advised ) target ) . getTargetSource ( ) . getTargetClass ( ) : target . getClass ( ) ; if ( mi != null ) { ReflectionUtils . doWithMethods ( targetClass , new ReflectionUtils . MethodCallback ( ) { public void doWith ( Method method ) throws IllegalArgumentException , IllegalAccessException { Annotation annotation = AnnotationUtils . findAnnotation ( method , annotationType ) ; if ( annotation != null ) { Class < ? > [ ] paramTypes = method . getParameterTypes ( ) ; if ( paramTypes . length > 0 ) { String errorMsg = "The method [" + method . getName ( ) + "] on target class [" + targetClass . getSimpleName ( ) + "] is incompatable with the signature [" + getParamTypesString ( expectedParamTypes ) + "] expected for the annotation [" + annotationType . getSimpleName ( ) + "]." ; Assert . isTrue ( paramTypes . length == expectedParamTypes . length , errorMsg ) ; for ( int i = 0 ; i < paramTypes . length ; i ++ ) { Assert . isTrue ( expectedParamTypes [ i ] . isAssignableFrom ( paramTypes [ i ] ) , errorMsg ) ; } } } } } ) ; } return mi ; } | Create a MethodInvoker from the delegate based on the annotationType . Ensure that the annotated method has a valid set of parameters . |
31,228 | public void setTypeMap ( Map < Class < ? extends T > , C > map ) { this . classified = new ConcurrentHashMap < Class < ? extends T > , C > ( map ) ; } | Set the classifications up as a map . The keys are types and these will be mapped along with all their subclasses to the corresponding value . The most specific types will match first . |
31,229 | public C classify ( T classifiable ) { if ( classifiable == null ) { return this . defaultValue ; } @ SuppressWarnings ( "unchecked" ) Class < ? extends T > exceptionClass = ( Class < ? extends T > ) classifiable . getClass ( ) ; if ( this . classified . containsKey ( exceptionClass ) ) { return this . classified . get ( exceptionClass ) ; } C value = null ; for ( Class < ? > cls = exceptionClass ; ! cls . equals ( Object . class ) && value == null ; cls = cls . getSuperclass ( ) ) { value = this . classified . get ( cls ) ; } if ( value != null ) { this . classified . put ( exceptionClass , value ) ; } if ( value == null ) { value = this . defaultValue ; } return value ; } | Return the value from the type map whose key is the class of the given Throwable or its nearest ancestor if a subclass . |
31,230 | public List < Long > executeSingleSimulation ( ) { StealingSleeper stealingSleeper = new StealingSleeper ( ) ; SleepingBackOffPolicy < ? > stealingBackoff = backOffPolicy . withSleeper ( stealingSleeper ) ; RetryTemplate template = new RetryTemplate ( ) ; template . setBackOffPolicy ( stealingBackoff ) ; template . setRetryPolicy ( retryPolicy ) ; try { template . execute ( new FailingRetryCallback ( ) ) ; } catch ( FailingRetryException e ) { } catch ( Throwable e ) { throw new RuntimeException ( "Unexpected exception" , e ) ; } return stealingSleeper . getSleeps ( ) ; } | Execute a single simulation |
31,231 | public void setPolicies ( RetryPolicy [ ] policies ) { this . policies = Arrays . asList ( policies ) . toArray ( new RetryPolicy [ policies . length ] ) ; } | Setter for policies . |
31,232 | public boolean canRetry ( RetryContext context ) { RetryContext [ ] contexts = ( ( CompositeRetryContext ) context ) . contexts ; RetryPolicy [ ] policies = ( ( CompositeRetryContext ) context ) . policies ; boolean retryable = true ; if ( this . optimistic ) { retryable = false ; for ( int i = 0 ; i < contexts . length ; i ++ ) { if ( policies [ i ] . canRetry ( contexts [ i ] ) ) { retryable = true ; } } } else { for ( int i = 0 ; i < contexts . length ; i ++ ) { if ( ! policies [ i ] . canRetry ( contexts [ i ] ) ) { retryable = false ; } } } return retryable ; } | Delegate to the policies that were in operation when the context was created . If any of them cannot retry then return false otherwise return true . |
31,233 | public RetryContext open ( RetryContext parent ) { List < RetryContext > list = new ArrayList < RetryContext > ( ) ; for ( RetryPolicy policy : this . policies ) { list . add ( policy . open ( parent ) ) ; } return new CompositeRetryContext ( parent , list , this . policies ) ; } | Creates a new context that copies the existing policies and keeps a list of the contexts from each one . |
31,234 | public void registerThrowable ( RetryContext context , Throwable throwable ) { RetryContext [ ] contexts = ( ( CompositeRetryContext ) context ) . contexts ; RetryPolicy [ ] policies = ( ( CompositeRetryContext ) context ) . policies ; for ( int i = 0 ; i < contexts . length ; i ++ ) { policies [ i ] . registerThrowable ( contexts [ i ] , throwable ) ; } ( ( RetryContextSupport ) context ) . registerThrowable ( throwable ) ; } | Delegate to the policies that were in operation when the context was created . |
31,235 | public void setPolicyMap ( Map < Class < ? extends Throwable > , RetryPolicy > policyMap ) { this . exceptionClassifier = new SubclassClassifier < Throwable , RetryPolicy > ( policyMap , new NeverRetryPolicy ( ) ) ; } | Setter for policy map used to create a classifier . Either this property or the exception classifier directly should be set but not both . |
31,236 | public boolean canRetry ( RetryContext context ) { Throwable t = context . getLastThrowable ( ) ; return ( t == null || retryForException ( t ) ) && context . getRetryCount ( ) < this . maxAttempts ; } | Test for retryable operation based on the status . |
31,237 | public void registerThrowable ( RetryContext context , Throwable throwable ) { SimpleRetryContext simpleContext = ( ( SimpleRetryContext ) context ) ; simpleContext . registerThrowable ( throwable ) ; } | Update the status with another attempted retry and the latest exception . |
31,238 | public T classify ( C classifiable ) { return this . matcher . classify ( this . router . classify ( classifiable ) ) ; } | Classify the input and map to a String then take that and put it into a pattern matcher to match to an output value . |
31,239 | public void registerThrowable ( RetryContext context , Throwable throwable ) { ( ( NeverRetryContext ) context ) . setFinished ( ) ; ( ( RetryContextSupport ) context ) . registerThrowable ( throwable ) ; } | Make the throwable available for downstream use through the context . |
31,240 | private static Expression getExpression ( String expression ) { if ( isTemplate ( expression ) ) { logger . warn ( "#{...} syntax is not required for this run-time expression " + "and is deprecated in favor of a simple expression string" ) ; return new SpelExpressionParser ( ) . parseExpression ( expression , PARSER_CONTEXT ) ; } return new SpelExpressionParser ( ) . parseExpression ( expression ) ; } | Get expression based on the expression string . At the moment supports both literal and template expressions . Template expressions are deprecated . |
31,241 | private static boolean isTemplate ( String expression ) { return expression . contains ( PARSER_CONTEXT . getExpressionPrefix ( ) ) && expression . contains ( PARSER_CONTEXT . getExpressionSuffix ( ) ) ; } | Check if the expression is a template |
31,242 | public static void generate ( GenerationConfig config ) throws IOException { Annotator annotator = getAnnotator ( config ) ; RuleFactory ruleFactory = createRuleFactory ( config ) ; ruleFactory . setAnnotator ( annotator ) ; ruleFactory . setGenerationConfig ( config ) ; ruleFactory . setSchemaStore ( new SchemaStore ( createContentResolver ( config ) ) ) ; SchemaMapper mapper = new SchemaMapper ( ruleFactory , createSchemaGenerator ( config ) ) ; JCodeModel codeModel = new JCodeModel ( ) ; if ( config . isRemoveOldOutput ( ) ) { removeOldOutput ( config . getTargetDirectory ( ) ) ; } for ( Iterator < URL > sources = config . getSource ( ) ; sources . hasNext ( ) ; ) { URL source = sources . next ( ) ; if ( URLUtil . parseProtocol ( source . toString ( ) ) == URLProtocol . FILE && URLUtil . getFileFromURL ( source ) . isDirectory ( ) ) { generateRecursive ( config , mapper , codeModel , defaultString ( config . getTargetPackage ( ) ) , Arrays . asList ( URLUtil . getFileFromURL ( source ) . listFiles ( config . getFileFilter ( ) ) ) ) ; } else { mapper . generate ( codeModel , getNodeName ( source , config ) , defaultString ( config . getTargetPackage ( ) ) , source ) ; } } if ( config . getTargetDirectory ( ) . exists ( ) || config . getTargetDirectory ( ) . mkdirs ( ) ) { if ( config . getTargetLanguage ( ) == Language . SCALA ) { CodeWriter sourcesWriter = new ScalaFileCodeWriter ( config . getTargetDirectory ( ) , config . getOutputEncoding ( ) ) ; CodeWriter resourcesWriter = new FileCodeWriterWithEncoding ( config . getTargetDirectory ( ) , config . getOutputEncoding ( ) ) ; codeModel . build ( sourcesWriter , resourcesWriter ) ; } else { CodeWriter sourcesWriter = new FileCodeWriterWithEncoding ( config . getTargetDirectory ( ) , config . getOutputEncoding ( ) ) ; CodeWriter resourcesWriter = new FileCodeWriterWithEncoding ( config . getTargetDirectory ( ) , config . getOutputEncoding ( ) ) ; codeModel . build ( sourcesWriter , resourcesWriter ) ; } } else { throw new GenerationException ( "Could not create or access target directory " + config . getTargetDirectory ( ) . getAbsolutePath ( ) ) ; } } | Reads the contents of the given source and initiates schema generation . |
31,243 | public JFieldVar searchSuperClassesForField ( String property , JDefinedClass jclass ) { JClass superClass = jclass . _extends ( ) ; JDefinedClass definedSuperClass = definedClassOrNullFromType ( superClass ) ; if ( definedSuperClass == null ) { return null ; } return searchClassAndSuperClassesForField ( property , definedSuperClass ) ; } | This is recursive with searchClassAndSuperClassesForField |
31,244 | private JDefinedClass createClass ( String nodeName , JsonNode node , JPackage _package ) throws ClassAlreadyExistsException { JDefinedClass newType ; Annotator annotator = ruleFactory . getAnnotator ( ) ; try { if ( node . has ( "existingJavaType" ) ) { String fqn = substringBefore ( node . get ( "existingJavaType" ) . asText ( ) , "<" ) ; if ( isPrimitive ( fqn , _package . owner ( ) ) ) { throw new ClassAlreadyExistsException ( primitiveType ( fqn , _package . owner ( ) ) ) ; } JClass existingClass = resolveType ( _package , fqn + ( node . get ( "existingJavaType" ) . asText ( ) . contains ( "<" ) ? "<" + substringAfter ( node . get ( "existingJavaType" ) . asText ( ) , "<" ) : "" ) ) ; throw new ClassAlreadyExistsException ( existingClass ) ; } boolean usePolymorphicDeserialization = annotator . isPolymorphicDeserializationSupported ( node ) ; if ( node . has ( "javaType" ) ) { String fqn = node . path ( "javaType" ) . asText ( ) ; if ( isPrimitive ( fqn , _package . owner ( ) ) ) { throw new GenerationException ( "javaType cannot refer to a primitive type (" + fqn + "), did you mean to use existingJavaType?" ) ; } if ( fqn . contains ( "<" ) ) { throw new GenerationException ( "javaType does not support generic args (" + fqn + "), did you mean to use existingJavaType?" ) ; } int index = fqn . lastIndexOf ( "." ) + 1 ; if ( index >= 0 && index < fqn . length ( ) ) { fqn = fqn . substring ( 0 , index ) + ruleFactory . getGenerationConfig ( ) . getClassNamePrefix ( ) + fqn . substring ( index ) + ruleFactory . getGenerationConfig ( ) . getClassNameSuffix ( ) ; } if ( usePolymorphicDeserialization ) { newType = _package . owner ( ) . _class ( JMod . PUBLIC , fqn , ClassType . CLASS ) ; } else { newType = _package . owner ( ) . _class ( fqn ) ; } } else { if ( usePolymorphicDeserialization ) { newType = _package . _class ( JMod . PUBLIC , ruleFactory . getNameHelper ( ) . getUniqueClassName ( nodeName , node , _package ) , ClassType . CLASS ) ; } else { newType = _package . _class ( ruleFactory . getNameHelper ( ) . getUniqueClassName ( nodeName , node , _package ) ) ; } } } catch ( JClassAlreadyExistsException e ) { throw new ClassAlreadyExistsException ( e . getExistingClass ( ) ) ; } annotator . typeInfo ( newType , node ) ; annotator . propertyInclusion ( newType , node ) ; return newType ; } | Creates a new Java class that will be generated . |
31,245 | public String getPropertyName ( String jsonFieldName , JsonNode node ) { jsonFieldName = getFieldName ( jsonFieldName , node ) ; jsonFieldName = replaceIllegalCharacters ( jsonFieldName ) ; jsonFieldName = normalizeName ( jsonFieldName ) ; jsonFieldName = makeLowerCamelCase ( jsonFieldName ) ; if ( isKeyword ( jsonFieldName ) ) { jsonFieldName = "_" + jsonFieldName ; } if ( isKeyword ( jsonFieldName ) ) { jsonFieldName += "_" ; } return jsonFieldName ; } | Convert jsonFieldName into the equivalent Java fieldname by replacing illegal characters and normalizing it . |
31,246 | public String getSetterName ( String propertyName , JsonNode node ) { propertyName = getPropertyNameForAccessor ( propertyName , node ) ; String prefix = "set" ; String setterName ; if ( propertyName . length ( ) > 1 && Character . isUpperCase ( propertyName . charAt ( 1 ) ) ) { setterName = prefix + propertyName ; } else { setterName = prefix + capitalize ( propertyName ) ; } if ( setterName . equals ( "setClass" ) ) { setterName = "setClass_" ; } return setterName ; } | Generate setter method name for property . |
31,247 | public String getFieldName ( String propertyName , JsonNode node ) { if ( node != null && node . has ( "javaName" ) ) { propertyName = node . get ( "javaName" ) . textValue ( ) ; } return propertyName ; } | Get name of the field generated from property . |
31,248 | public String getGetterName ( String propertyName , JType type , JsonNode node ) { propertyName = getPropertyNameForAccessor ( propertyName , node ) ; String prefix = type . equals ( type . owner ( ) . _ref ( boolean . class ) ) ? "is" : "get" ; String getterName ; if ( propertyName . length ( ) > 1 && Character . isUpperCase ( propertyName . charAt ( 1 ) ) ) { getterName = prefix + propertyName ; } else { getterName = prefix + capitalize ( propertyName ) ; } if ( getterName . equals ( "getClass" ) ) { getterName = "getClass_" ; } return getterName ; } | Generate getter method name for property . |
31,249 | public ClassLoader getClassLoader ( MavenProject project , final ClassLoader parent , Log log ) throws DependencyResolutionRequiredException { @ SuppressWarnings ( "unchecked" ) List < String > classpathElements = project . getCompileClasspathElements ( ) ; final List < URL > classpathUrls = new ArrayList < > ( classpathElements . size ( ) ) ; for ( String classpathElement : classpathElements ) { try { log . debug ( "Adding project artifact to classpath: " + classpathElement ) ; classpathUrls . add ( new File ( classpathElement ) . toURI ( ) . toURL ( ) ) ; } catch ( MalformedURLException e ) { log . debug ( "Unable to use classpath entry as it could not be understood as a valid URL: " + classpathElement , e ) ; } } return AccessController . doPrivileged ( new PrivilegedAction < ClassLoader > ( ) { public ClassLoader run ( ) { return new URLClassLoader ( classpathUrls . toArray ( new URL [ classpathUrls . size ( ) ] ) , parent ) ; } } ) ; } | Provides a class loader that can be used to load classes from this project classpath . |
31,250 | public static boolean isPrimitive ( String name , JCodeModel owner ) { try { return JType . parse ( owner , name ) != owner . VOID ; } catch ( IllegalArgumentException e ) { return false ; } } | Check if a name string refers to a given type . |
31,251 | @ edu . umd . cs . findbugs . annotations . SuppressWarnings ( value = { "NP_UNWRITTEN_FIELD" , "UWF_UNWRITTEN_FIELD" } , justification = "Private fields set by Maven." ) @ SuppressWarnings ( "PMD.UselessParentheses" ) public void execute ( ) throws MojoExecutionException { addProjectDependenciesToClasspath ( ) ; try { getAnnotationStyle ( ) ; } catch ( IllegalArgumentException e ) { throw new MojoExecutionException ( "Not a valid annotation style: " + annotationStyle ) ; } try { new AnnotatorFactory ( this ) . getAnnotator ( getCustomAnnotator ( ) ) ; } catch ( IllegalArgumentException e ) { throw new MojoExecutionException ( e . getMessage ( ) , e ) ; } if ( skip ) { return ; } if ( sourceDirectory != null ) { sourceDirectory = FilenameUtils . normalize ( sourceDirectory ) ; try { URLUtil . parseURL ( sourceDirectory ) ; } catch ( IllegalArgumentException e ) { throw new MojoExecutionException ( e . getMessage ( ) , e ) ; } } else if ( ! isEmpty ( sourcePaths ) ) { for ( int i = 0 ; i < sourcePaths . length ; i ++ ) { sourcePaths [ i ] = FilenameUtils . normalize ( sourcePaths [ i ] ) ; try { URLUtil . parseURL ( sourcePaths [ i ] ) ; } catch ( IllegalArgumentException e ) { throw new MojoExecutionException ( e . getMessage ( ) , e ) ; } } } else { throw new MojoExecutionException ( "One of sourceDirectory or sourcePaths must be provided" ) ; } if ( filteringEnabled ( ) || ( sourceDirectory != null && isEmpty ( sourcePaths ) ) ) { if ( sourceDirectory == null ) { throw new MojoExecutionException ( "Source includes and excludes require the sourceDirectory property" ) ; } if ( ! isEmpty ( sourcePaths ) ) { throw new MojoExecutionException ( "Source includes and excludes are incompatible with the sourcePaths property" ) ; } fileFilter = createFileFilter ( ) ; } if ( addCompileSourceRoot ) { project . addCompileSourceRoot ( outputDirectory . getPath ( ) ) ; } if ( useCommonsLang3 ) { getLog ( ) . warn ( "useCommonsLang3 is deprecated. Please remove it from your config." ) ; } try { Jsonschema2Pojo . generate ( this ) ; } catch ( IOException e ) { throw new MojoExecutionException ( "Error generating classes from JSON Schema file(s) " + sourceDirectory , e ) ; } } | Executes the plugin to read the given source and behavioural properties and generate POJOs . The current implementation acts as a wrapper around the command line interface . |
31,252 | public JType generate ( JCodeModel codeModel , String className , String packageName , URL schemaUrl ) { JPackage jpackage = codeModel . _package ( packageName ) ; ObjectNode schemaNode = readSchema ( schemaUrl ) ; return ruleFactory . getSchemaRule ( ) . apply ( className , schemaNode , null , jpackage , new Schema ( null , schemaNode , null ) ) ; } | Reads a schema and adds generated types to the given code model . |
31,253 | public synchronized Schema create ( URI id , String refFragmentPathDelimiters ) { if ( ! schemas . containsKey ( id ) ) { URI baseId = removeFragment ( id ) ; JsonNode baseContent = contentResolver . resolve ( baseId ) ; Schema baseSchema = new Schema ( baseId , baseContent , null ) ; if ( id . toString ( ) . contains ( "#" ) ) { JsonNode childContent = fragmentResolver . resolve ( baseContent , '#' + id . getFragment ( ) , refFragmentPathDelimiters ) ; schemas . put ( id , new Schema ( id , childContent , baseSchema ) ) ; } else { schemas . put ( id , baseSchema ) ; } } return schemas . get ( id ) ; } | Create or look up a new schema which has the given ID and read the contents of the given ID as a URL . If a schema with the given ID is already known then a reference to the original schema will be returned . |
31,254 | @ SuppressWarnings ( "PMD.UselessParentheses" ) public Schema create ( Schema parent , String path , String refFragmentPathDelimiters ) { if ( ! path . equals ( "#" ) ) { path = stripEnd ( path , "#?&/" ) ; } if ( path . contains ( "#" ) ) { String pathExcludingFragment = substringBefore ( path , "#" ) ; String fragment = substringAfter ( path , "#" ) ; URI fragmentURI ; try { fragmentURI = new URI ( null , null , fragment ) ; } catch ( URISyntaxException e ) { throw new IllegalArgumentException ( "Invalid fragment: " + fragment + " in path: " + path ) ; } path = pathExcludingFragment + "#" + fragmentURI . getRawFragment ( ) ; } URI id = ( parent == null || parent . getId ( ) == null ) ? URI . create ( path ) : parent . getId ( ) . resolve ( path ) ; String stringId = id . toString ( ) ; if ( stringId . endsWith ( "#" ) ) { try { id = new URI ( stripEnd ( stringId , "#" ) ) ; } catch ( URISyntaxException e ) { throw new IllegalArgumentException ( "Bad path: " + stringId ) ; } } if ( selfReferenceWithoutParentFile ( parent , path ) || substringBefore ( stringId , "#" ) . isEmpty ( ) ) { JsonNode parentContent = parent . getParent ( ) . getContent ( ) ; Schema schema = new Schema ( id , fragmentResolver . resolve ( parentContent , path , refFragmentPathDelimiters ) , parent . getParent ( ) ) ; schemas . put ( id , schema ) ; return schema ; } return create ( id , refFragmentPathDelimiters ) ; } | Create or look up a new schema using the given schema as a parent and the path as a relative reference . If a schema with the given parent and relative path is already known then a reference to the original schema will be returned . |
31,255 | private JType getIntegerType ( JCodeModel owner , JsonNode node , GenerationConfig config ) { if ( config . isUseBigIntegers ( ) ) { return unboxIfNecessary ( owner . ref ( BigInteger . class ) , config ) ; } else if ( config . isUseLongIntegers ( ) || node . has ( "minimum" ) && node . get ( "minimum" ) . isLong ( ) || node . has ( "maximum" ) && node . get ( "maximum" ) . isLong ( ) ) { return unboxIfNecessary ( owner . ref ( Long . class ) , config ) ; } else { return unboxIfNecessary ( owner . ref ( Integer . class ) , config ) ; } } | Returns the JType for an integer field . Handles type lookup and unboxing . |
31,256 | private JType getNumberType ( JCodeModel owner , GenerationConfig config ) { if ( config . isUseBigDecimals ( ) ) { return unboxIfNecessary ( owner . ref ( BigDecimal . class ) , config ) ; } else if ( config . isUseDoubleNumbers ( ) ) { return unboxIfNecessary ( owner . ref ( Double . class ) , config ) ; } else { return unboxIfNecessary ( owner . ref ( Float . class ) , config ) ; } } | Returns the JType for a number field . Handles type lookup and unboxing . |
31,257 | @ SuppressWarnings ( "unchecked" ) public void setCustomAnnotator ( String customAnnotator ) { if ( isNotBlank ( customAnnotator ) ) { try { this . customAnnotator = ( Class < ? extends Annotator > ) Class . forName ( customAnnotator ) ; } catch ( ClassNotFoundException e ) { throw new IllegalArgumentException ( e ) ; } } else { this . customAnnotator = NoopAnnotator . class ; } } | Sets the customAnnotator property of this class |
31,258 | private LinkedHashSet < String > getSuperTypeConstructorPropertiesRecursive ( JsonNode node , Schema schema , boolean onlyRequired ) { Schema superTypeSchema = reflectionHelper . getSuperSchema ( node , schema , true ) ; if ( superTypeSchema == null ) { return new LinkedHashSet < > ( ) ; } JsonNode superSchemaNode = superTypeSchema . getContent ( ) ; LinkedHashSet < String > rtn = getConstructorProperties ( superSchemaNode , onlyRequired ) ; rtn . addAll ( getSuperTypeConstructorPropertiesRecursive ( superSchemaNode , superTypeSchema , onlyRequired ) ) ; return rtn ; } | Recursive walks the schema tree and assembles a list of all properties of this schema s super schemas |
31,259 | public static String getDateAsString ( final double JULIAN_DAY , final int TIMEZONE_OFFSET ) throws Exception { if ( JULIAN_DAY == - 1 ) return "NO RISE/SET/TRANSIT FOR THIS OBSERVER/DATE" ; int date [ ] = SunMoonCalculator . getDate ( JULIAN_DAY ) ; return date [ 0 ] + "/" + date [ 1 ] + "/" + date [ 2 ] + " " + ( ( date [ 3 ] + TIMEZONE_OFFSET ) % 24 ) + ":" + date [ 4 ] + ":" + date [ 5 ] + " UT" ; } | Returns a date as a string . |
31,260 | public void calcSunAndMoon ( ) { double jd = this . jd_UT ; double out [ ] = doCalc ( getSun ( ) ) ; sunAz = out [ 0 ] ; sunEl = out [ 1 ] ; sunrise = out [ 2 ] ; sunset = out [ 3 ] ; sunTransit = out [ 4 ] ; sunTransitElev = out [ 5 ] ; sunDist = out [ 8 ] ; double sa = sanomaly , sl = slongitude ; int niter = 3 ; sunrise = obtainAccurateRiseSetTransit ( sunrise , 2 , niter , true ) ; sunset = obtainAccurateRiseSetTransit ( sunset , 3 , niter , true ) ; sunTransit = obtainAccurateRiseSetTransit ( sunTransit , 4 , niter , true ) ; if ( sunTransit == - 1 ) { sunTransitElev = 0 ; } else { setUTDate ( sunTransit ) ; out = doCalc ( getSun ( ) ) ; sunTransitElev = out [ 5 ] ; } setUTDate ( jd ) ; sanomaly = sa ; slongitude = sl ; out = doCalc ( getMoon ( ) ) ; moonAz = out [ 0 ] ; moonEl = out [ 1 ] ; moonRise = out [ 2 ] ; moonSet = out [ 3 ] ; moonTransit = out [ 4 ] ; moonTransitElev = out [ 5 ] ; moonDist = out [ 8 ] ; double ma = moonAge ; niter = 5 ; moonRise = obtainAccurateRiseSetTransit ( moonRise , 2 , niter , false ) ; moonSet = obtainAccurateRiseSetTransit ( moonSet , 3 , niter , false ) ; moonTransit = obtainAccurateRiseSetTransit ( moonTransit , 4 , niter , false ) ; if ( moonTransit == - 1 ) { moonTransitElev = 0 ; } else { setUTDate ( moonTransit ) ; getSun ( ) ; out = doCalc ( getMoon ( ) ) ; moonTransitElev = out [ 5 ] ; } setUTDate ( jd ) ; sanomaly = sa ; slongitude = sl ; moonAge = ma ; } | Calculates everything for the Sun and the Moon . |
31,261 | public void setReferenceValue ( final double VALUE ) { if ( null == referenceValue ) { _referenceValue = VALUE ; fireTileEvent ( REDRAW_EVENT ) ; } else { referenceValue . set ( VALUE ) ; } } | Defines the reference value that will be used in the HighLowTileSkin |
31,262 | public void setTitle ( final String TITLE ) { if ( null == title ) { _title = null == TITLE ? "" : TITLE ; fireTileEvent ( VISIBILITY_EVENT ) ; fireTileEvent ( REDRAW_EVENT ) ; } else { title . set ( TITLE ) ; } } | Sets the title of the gauge . This title will only be visible if it is not empty . |
31,263 | public void setTitleAlignment ( final TextAlignment ALIGNMENT ) { if ( null == titleAlignment ) { _titleAlignment = ALIGNMENT ; fireTileEvent ( RESIZE_EVENT ) ; } else { titleAlignment . set ( ALIGNMENT ) ; } } | Defines the alignment that will be used to align the title in the Tile . Keep in mind that this property will not be used by every skin . |
31,264 | public void setDescription ( final String DESCRIPTION ) { if ( null == description ) { _description = DESCRIPTION ; fireTileEvent ( VISIBILITY_EVENT ) ; fireTileEvent ( REDRAW_EVENT ) ; } else { description . set ( DESCRIPTION ) ; } } | Sets the description text of the gauge . This description text will usually only be visible if it is not empty . |
31,265 | public void setUnit ( final String UNIT ) { if ( null == unit ) { _unit = UNIT ; fireTileEvent ( VISIBILITY_EVENT ) ; fireTileEvent ( REDRAW_EVENT ) ; } else { unit . set ( UNIT ) ; } } | Sets the unit of the gauge . This unit will usually only be visible if it is not empty . |
31,266 | public void setFlipText ( final String TEXT ) { if ( null == flipText ) { _flipText = TEXT ; if ( ! oldFlipText . equals ( _flipText ) ) { fireTileEvent ( FLIP_START_EVENT ) ; } oldFlipText = _flipText ; } else { flipText . set ( TEXT ) ; } } | Defines the text that will be used to visualize the FlipTileSkin |
31,267 | public void setActive ( final boolean SELECTED ) { if ( null == active ) { _active = SELECTED ; fireTileEvent ( REDRAW_EVENT ) ; } else { active . set ( SELECTED ) ; } } | Defines if the switch in the SwitchTileSkin is active |
31,268 | public void setDuration ( final LocalTime DURATION ) { if ( null == duration ) { _duration = DURATION ; fireTileEvent ( REDRAW_EVENT ) ; } else { duration . set ( DURATION ) ; } } | Defines a duration that is used in the TimeTileSkin |
31,269 | public void setForegroundBaseColor ( final Color COLOR ) { if ( null == titleColor ) { _titleColor = COLOR ; } else { titleColor . set ( COLOR ) ; } if ( null == descriptionColor ) { _descriptionColor = COLOR ; } else { descriptionColor . set ( COLOR ) ; } if ( null == unitColor ) { _unitColor = COLOR ; } else { unitColor . set ( COLOR ) ; } if ( null == valueColor ) { _valueColor = COLOR ; } else { valueColor . set ( COLOR ) ; } if ( null == textColor ) { _textColor = COLOR ; } else { textColor . set ( COLOR ) ; } if ( null == foregroundColor ) { _foregroundColor = COLOR ; } else { foregroundColor . set ( COLOR ) ; } fireTileEvent ( REDRAW_EVENT ) ; } | A convenient method to set the color of foreground elements like title description unit value tickLabel and tickMark to the given Color . |
31,270 | public void setTextSize ( final TextSize SIZE ) { if ( null == textSize ) { _textSize = SIZE ; fireTileEvent ( REDRAW_EVENT ) ; } else { textSize . set ( SIZE ) ; } } | Defines the text size that will be used for the title subtitle and text in the different skins . |
31,271 | public void setRoundedCorners ( final boolean ROUNDED ) { if ( null == roundedCorners ) { _roundedCorners = ROUNDED ; fireTileEvent ( REDRAW_EVENT ) ; } else { roundedCorners . set ( ROUNDED ) ; } } | Switches the corners of the Tiles between rounded and rectangular |
31,272 | public void setForegroundColor ( final Color COLOR ) { if ( null == foregroundColor ) { _foregroundColor = COLOR ; fireTileEvent ( REDRAW_EVENT ) ; } else { foregroundColor . set ( COLOR ) ; } } | Defines the Paint object that will be used to fill the gauge foreground . |
31,273 | public void setBackgroundColor ( final Color COLOR ) { if ( null == backgroundColor ) { _backgroundColor = COLOR ; fireTileEvent ( REDRAW_EVENT ) ; } else { backgroundColor . set ( COLOR ) ; } } | Defines the Paint object that will be used to fill the gauge background . |
31,274 | public void setBorderColor ( final Color PAINT ) { if ( null == borderColor ) { _borderColor = PAINT ; fireTileEvent ( REDRAW_EVENT ) ; } else { borderColor . set ( PAINT ) ; } } | Defines the Paint object that will be used to draw the border of the gauge . |
31,275 | public void setBorderWidth ( final double WIDTH ) { if ( null == borderWidth ) { _borderWidth = clamp ( 0.0 , 50.0 , WIDTH ) ; fireTileEvent ( REDRAW_EVENT ) ; } else { borderWidth . set ( WIDTH ) ; } } | Defines the width in pixels that will be used to draw the border of the gauge . The value will be clamped between 0 and 50 pixels . |
31,276 | public void setKnobColor ( final Color COLOR ) { if ( null == knobColor ) { _knobColor = COLOR ; fireTileEvent ( RESIZE_EVENT ) ; } else { knobColor . set ( COLOR ) ; } } | Defines the color that will be used to colorize the knob of the radial gauges . |
31,277 | public void setTickLabelDecimals ( final int DECIMALS ) { if ( null == tickLabelDecimals ) { _tickLabelDecimals = clamp ( 0 , MAX_NO_OF_DECIMALS , DECIMALS ) ; fireTileEvent ( REDRAW_EVENT ) ; } else { tickLabelDecimals . set ( DECIMALS ) ; } } | Defines the number of tickLabelDecimals that will be used to format the ticklabels of the gauge . The number of tickLabelDecimals will be clamped to a value between 0 - 3 . |
31,278 | public void setDescriptionColor ( final Color COLOR ) { if ( null == descriptionColor ) { _descriptionColor = COLOR ; fireTileEvent ( REDRAW_EVENT ) ; } else { descriptionColor . set ( COLOR ) ; } } | Defines the color that will be used to colorize the description text of the gauge . |
31,279 | public void setUnitColor ( final Color COLOR ) { if ( null == unitColor ) { _unitColor = COLOR ; fireTileEvent ( REDRAW_EVENT ) ; } else { unitColor . set ( COLOR ) ; } } | Defines the color that will be used to colorize the unit of the gauge . |
31,280 | public void setValueColor ( final Color COLOR ) { if ( null == valueColor ) { _valueColor = COLOR ; fireTileEvent ( REDRAW_EVENT ) ; } else { valueColor . set ( COLOR ) ; } } | Defines the color that will be used to colorize the value of the gauge . |
31,281 | public void setThresholdColor ( final Color COLOR ) { if ( null == thresholdColor ) { _thresholdColor = COLOR ; fireTileEvent ( REDRAW_EVENT ) ; } else { thresholdColor . set ( COLOR ) ; } } | Defines the color that will be used to colorize the threshold indicator of the gauge . |
31,282 | public void setSectionsVisible ( final boolean VISIBLE ) { if ( null == sectionsVisible ) { _sectionsVisible = VISIBLE ; fireTileEvent ( REDRAW_EVENT ) ; } else { sectionsVisible . set ( VISIBLE ) ; } } | Defines if the sections will be drawn |
31,283 | public void setHighlightSections ( final boolean HIGHLIGHT ) { if ( null == highlightSections ) { _highlightSections = HIGHLIGHT ; fireTileEvent ( REDRAW_EVENT ) ; } else { highlightSections . set ( HIGHLIGHT ) ; } } | Defines if sections should be highlighted in case they contain the current value |
31,284 | public ZonedDateTime getTime ( ) { if ( null == time ) { ZonedDateTime now = ZonedDateTime . now ( ) ; time = new ObjectPropertyBase < ZonedDateTime > ( now ) { protected void invalidated ( ) { zoneId = get ( ) . getZone ( ) ; fireTileEvent ( RECALC_EVENT ) ; if ( ! isRunning ( ) && isAnimated ( ) ) { long animationDuration = getAnimationDuration ( ) ; timeline . stop ( ) ; final KeyValue KEY_VALUE = new KeyValue ( currentTime , now . toEpochSecond ( ) ) ; final KeyFrame KEY_FRAME = new KeyFrame ( javafx . util . Duration . millis ( animationDuration ) , KEY_VALUE ) ; timeline . getKeyFrames ( ) . setAll ( KEY_FRAME ) ; timeline . setOnFinished ( e -> fireTileEvent ( FINISHED_EVENT ) ) ; timeline . play ( ) ; } else { currentTime . set ( now . toEpochSecond ( ) ) ; fireTileEvent ( FINISHED_EVENT ) ; } } public Object getBean ( ) { return Tile . this ; } public String getName ( ) { return "time" ; } } ; } return time . get ( ) ; } | Returns the current time of the clock . |
31,285 | public void setTextAlignment ( final TextAlignment ALIGNMENT ) { if ( null == textAlignment ) { _textAlignment = ALIGNMENT ; fireTileEvent ( RESIZE_EVENT ) ; } else { textAlignment . set ( ALIGNMENT ) ; } } | Defines the alignment that will be used to align the text in the Tile . Keep in mind that this property will not be used by every skin . |
31,286 | public void setDiscreteSeconds ( boolean DISCRETE ) { if ( null == discreteSeconds ) { _discreteSeconds = DISCRETE ; stopTask ( periodicTickTask ) ; if ( isAnimated ( ) ) return ; scheduleTickTask ( ) ; } else { discreteSeconds . set ( DISCRETE ) ; } } | Defines if the second hand of the clock should move in discrete steps of 1 second . Otherwise it will move continuously like in an automatic clock . |
31,287 | public void setDiscreteMinutes ( boolean DISCRETE ) { if ( null == discreteMinutes ) { _discreteMinutes = DISCRETE ; stopTask ( periodicTickTask ) ; if ( isAnimated ( ) ) return ; scheduleTickTask ( ) ; } else { discreteMinutes . set ( DISCRETE ) ; } } | Defines if the minute hand of the clock should move in discrete steps of 1 minute . Otherwise it will move continuously like in an automatic clock . |
31,288 | public void setRunning ( boolean RUNNING ) { if ( null == running ) { _running = RUNNING ; if ( RUNNING && ! isAnimated ( ) ) { scheduleTickTask ( ) ; } else { stopTask ( periodicTickTask ) ; } } else { running . set ( RUNNING ) ; } } | Defines if the clock is running . The clock will only start running if animated == false ; |
31,289 | public void setHourTickMarkColor ( final Color COLOR ) { if ( null == hourTickMarkColor ) { _hourTickMarkColor = COLOR ; fireTileEvent ( REDRAW_EVENT ) ; } else { hourTickMarkColor . set ( COLOR ) ; } } | Defines the color that will be used to colorize the hour tickmarks of the clock . |
31,290 | public void setAlarmColor ( final Color COLOR ) { if ( null == alarmColor ) { _alarmColor = COLOR ; fireTileEvent ( REDRAW_EVENT ) ; } else { alarmColor . set ( COLOR ) ; } } | Defines the color that will be used to colorize the alarm icon |
31,291 | public void setHourColor ( final Color COLOR ) { if ( null == hourColor ) { _hourColor = COLOR ; fireTileEvent ( REDRAW_EVENT ) ; } else { hourColor . set ( COLOR ) ; } } | Defines the color that will be used to colorize the hour hand of the clock |
31,292 | public void setMinuteColor ( final Color COLOR ) { if ( null == minuteColor ) { _minuteColor = COLOR ; fireTileEvent ( REDRAW_EVENT ) ; } else { minuteColor . set ( COLOR ) ; } } | Defines the color that will be used to colorize the minute hand of the clock . |
31,293 | public void setTooltipText ( final String TEXT ) { if ( null == tooltipText ) { tooltip . setText ( TEXT ) ; if ( null == TEXT || TEXT . isEmpty ( ) ) { setTooltip ( null ) ; } else { setTooltip ( tooltip ) ; } } else { tooltipText . set ( TEXT ) ; } } | Defines the text that will be shown in the Tile tooltip |
31,294 | public void setRadarChartMode ( final RadarChart . Mode MODE ) { if ( null == radarChartMode ) { _radarChartMode = MODE ; fireTileEvent ( RECALC_EVENT ) ; } else { radarChartMode . set ( MODE ) ; } } | Defines the mode that is used in the RadarChartTileSkin to visualize the data in the RadarChart . There are Mode . POLYGON and Mode . SECTOR . |
31,295 | public Country getCountry ( ) { if ( null == _country && null == country ) { _country = Country . DE ; } return null == country ? _country : country . get ( ) ; } | Returns the Locale that will be used to visualize the country in the CountryTileSkin |
31,296 | public void setCountry ( final Country COUNTRY ) { if ( null == country ) { _country = COUNTRY ; fireTileEvent ( RECALC_EVENT ) ; } else { country . set ( COUNTRY ) ; } } | Defines the Locale that will be used to visualize the country in the CountryTileSkin |
31,297 | public void setStrokeWithGradient ( final boolean STROKE_WITH_GRADIENT ) { if ( null == strokeWithGradient ) { _strokeWithGradient = STROKE_WITH_GRADIENT ; fireTileEvent ( REDRAW_EVENT ) ; } else { strokeWithGradient . set ( STROKE_WITH_GRADIENT ) ; } } | Defines the usage of a gradient defined by gradientStops to stroke the line in the SparklineTileSkin |
31,298 | public void setFillWithGradient ( final boolean FILL_WITH_GRADIENT ) { if ( null == fillWithGradient ) { _fillWithGradient = FILL_WITH_GRADIENT ; fireTileEvent ( REDRAW_EVENT ) ; } else { fillWithGradient . set ( FILL_WITH_GRADIENT ) ; } } | Defines the usage of a gradient defined by gradientStops to fill the area in the SmoothAreaTileSkin |
31,299 | public void setStart ( final double START ) { if ( null == start ) { _start = START ; fireSectionEvent ( UPDATE_EVENT ) ; } else { start . set ( START ) ; } } | Defines the value where the section begins . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.