idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
150,300
public void fetchUninitializedAttributes ( ) { for ( String prefixedId : getPrefixedAttributeNames ( ) ) { BeanIdentifier id = getNamingScheme ( ) . deprefix ( prefixedId ) ; if ( ! beanStore . contains ( id ) ) { ContextualInstance < ? > instance = ( ContextualInstance < ? > ) getAttribute ( prefixedId ) ; beanStore ....
Fetch all relevant attributes from the backing store and copy instances which are not present in the local bean store .
150,301
static void merge ( Map < ConfigurationKey , Object > original , Map < ConfigurationKey , Object > toMerge , String mergedSourceDescription ) { for ( Entry < ConfigurationKey , Object > entry : toMerge . entrySet ( ) ) { Object existing = original . get ( entry . getKey ( ) ) ; if ( existing != null ) { ConfigurationLo...
Merge two maps of configuration properties . If the original contains a mapping for the same key the new mapping is ignored .
150,302
private Map < ConfigurationKey , Object > getObsoleteSystemProperties ( ) { Map < ConfigurationKey , Object > found = new EnumMap < ConfigurationKey , Object > ( ConfigurationKey . class ) ; String concurrentDeployment = getSystemProperty ( "org.jboss.weld.bootstrap.properties.concurrentDeployment" ) ; if ( concurrentD...
Try to get a system property for obsolete keys . The value is automatically converted - a runtime exception may be thrown during conversion .
150,303
@ SuppressFBWarnings ( value = "DMI_COLLECTION_OF_URLS" , justification = "Only local URLs involved" ) private Map < ConfigurationKey , Object > readFileProperties ( Set < URL > files ) { Map < ConfigurationKey , Object > found = new EnumMap < ConfigurationKey , Object > ( ConfigurationKey . class ) ; for ( URL file : ...
Read the set of property files . Keys and Values are automatically validated and converted .
150,304
private void processKeyValue ( Map < ConfigurationKey , Object > properties , ConfigurationKey key , Object value ) { if ( value instanceof String ) { value = key . convertValue ( ( String ) value ) ; } if ( key . isValidValue ( value ) ) { Object previous = properties . put ( key , value ) ; if ( previous != null && !...
Process the given key and value . First validate the value and check if there s no different value for the same key in the same source - invalid and different values are treated as a deployment problem .
150,305
public static < T , X > ObserverMethodImpl < T , X > create ( EnhancedAnnotatedMethod < T , ? super X > method , RIBean < X > declaringBean , BeanManagerImpl manager , boolean isAsync ) { if ( declaringBean instanceof ExtensionBean ) { return new ExtensionObserverMethodImpl < T , X > ( method , declaringBean , manager ...
Creates an observer
150,306
public static TransactionPhase getTransactionalPhase ( EnhancedAnnotatedMethod < ? , ? > observer ) { EnhancedAnnotatedParameter < ? , ? > parameter = observer . getEnhancedParameters ( Observes . class ) . iterator ( ) . next ( ) ; return parameter . getAnnotation ( Observes . class ) . during ( ) ; }
Tests an observer method to see if it is transactional .
150,307
static WeldContainer startInitialization ( String id , Deployment deployment , Bootstrap bootstrap ) { if ( SINGLETON . isSet ( id ) ) { throw WeldSELogger . LOG . weldContainerAlreadyRunning ( id ) ; } WeldContainer weldContainer = new WeldContainer ( id , deployment , bootstrap ) ; SINGLETON . set ( id , weldContaine...
Start the initialization .
150,308
static void endInitialization ( WeldContainer container , boolean isShutdownHookEnabled ) { container . complete ( ) ; if ( shutdownHook == null && isShutdownHookEnabled ) { synchronized ( LOCK ) { if ( shutdownHook == null ) { shutdownHook = new ShutdownHook ( ) ; SecurityActions . addShutdownHook ( shutdownHook ) ; }...
Finish the initialization .
150,309
public synchronized void shutdown ( ) { checkIsRunning ( ) ; try { beanManager ( ) . fireEvent ( new ContainerBeforeShutdown ( id ) , BeforeDestroyed . Literal . APPLICATION ) ; } finally { discard ( id ) ; creationalContext . release ( ) ; beanManager ( ) . fireEvent ( new ContainerShutdown ( id ) , Destroyed . Litera...
Shutdown the container .
150,310
public Collection < EnhancedAnnotatedConstructor < T > > getEnhancedConstructors ( Class < ? extends Annotation > annotationType ) { Set < EnhancedAnnotatedConstructor < T > > ret = new HashSet < EnhancedAnnotatedConstructor < T > > ( ) ; for ( EnhancedAnnotatedConstructor < T > constructor : constructors ) { if ( cons...
Gets constructors with given annotation type
150,311
protected void setBeanStore ( BoundBeanStore beanStore ) { if ( beanStore == null ) { this . beanStore . remove ( ) ; } else { this . beanStore . set ( beanStore ) ; } }
Sets the bean store
150,312
public void setArgs ( String [ ] args ) { if ( args == null ) { args = new String [ ] { } ; } this . args = args ; this . argsList = Collections . unmodifiableList ( new ArrayList < String > ( Arrays . asList ( args ) ) ) ; }
StartMain passes in the command line args here .
150,313
public Weld addPackages ( boolean scanRecursively , Class < ? > ... packageClasses ) { for ( Class < ? > packageClass : packageClasses ) { addPackage ( scanRecursively , packageClass ) ; } return this ; }
Packages of the specified classes will be scanned and found classes will be added to the set of bean classes for the synthetic bean archive .
150,314
public Weld addPackage ( boolean scanRecursively , Class < ? > packageClass ) { packages . add ( new PackInfo ( packageClass , scanRecursively ) ) ; return this ; }
A package of the specified class will be scanned and found classes will be added to the set of bean classes for the synthetic bean archive .
150,315
public Weld extensions ( Extension ... extensions ) { this . extensions . clear ( ) ; for ( Extension extension : extensions ) { addExtension ( extension ) ; } return this ; }
Define the set of extensions .
150,316
public Weld addExtension ( Extension extension ) { extensions . add ( new MetadataImpl < Extension > ( extension , SYNTHETIC_LOCATION_PREFIX + extension . getClass ( ) . getName ( ) ) ) ; return this ; }
Add an extension to the set of extensions .
150,317
public Weld property ( String key , Object value ) { properties . put ( key , value ) ; return this ; }
Set the configuration property .
150,318
public Weld addBeanDefiningAnnotations ( Class < ? extends Annotation > ... annotations ) { for ( Class < ? extends Annotation > annotation : annotations ) { this . extendedBeanDefiningAnnotations . add ( annotation ) ; } return this ; }
Registers annotations which will be considered as bean defining annotations .
150,319
private static void checkSensibility ( AnnotatedType < ? > type ) { if ( type . getConstructors ( ) . isEmpty ( ) && ! type . getJavaClass ( ) . isInterface ( ) ) { MetadataLogger . LOG . noConstructor ( type ) ; } Set < Class < ? > > hierarchy = new HashSet < Class < ? > > ( ) ; for ( Class < ? > clazz = type . getJav...
Checks if the given AnnotatedType is sensible otherwise provides warnings .
150,320
private static boolean isWideningPrimitive ( Class < ? > argumentClass , Class < ? > targetClass ) { return WIDENING_TABLE . containsKey ( argumentClass ) && WIDENING_TABLE . get ( argumentClass ) . contains ( targetClass ) ; }
Checks that the targetClass is widening the argument class
150,321
public static < X > String createTypeId ( AnnotatedType < X > annotatedType ) { String id = createTypeId ( annotatedType . getJavaClass ( ) , annotatedType . getAnnotations ( ) , annotatedType . getMethods ( ) , annotatedType . getFields ( ) , annotatedType . getConstructors ( ) ) ; String hash = hash ( id ) ; Metadata...
Generates a unique signature for an annotated type . Members without annotations are omitted to reduce the length of the signature
150,322
public static boolean compareAnnotatedParameters ( AnnotatedParameter < ? > p1 , AnnotatedParameter < ? > p2 ) { return compareAnnotatedCallable ( p1 . getDeclaringCallable ( ) , p2 . getDeclaringCallable ( ) ) && p1 . getPosition ( ) == p2 . getPosition ( ) && compareAnnotated ( p1 , p2 ) ; }
Compares two annotated parameters and returns true if they are equal
150,323
public static boolean compareAnnotatedTypes ( AnnotatedType < ? > t1 , AnnotatedType < ? > t2 ) { if ( ! t1 . getJavaClass ( ) . equals ( t2 . getJavaClass ( ) ) ) { return false ; } if ( ! compareAnnotated ( t1 , t2 ) ) { return false ; } if ( t1 . getFields ( ) . size ( ) != t2 . getFields ( ) . size ( ) ) { return f...
Compares two annotated types and returns true if they are the same
150,324
public static boolean isPassivatingScope ( Bean < ? > bean , BeanManagerImpl manager ) { if ( bean == null ) { return false ; } else { return manager . getServices ( ) . get ( MetaAnnotationStore . class ) . getScopeModel ( bean . getScope ( ) ) . isPassivating ( ) ; } }
Indicates if a bean s scope type is passivating
150,325
public static boolean isBeanProxyable ( Bean < ? > bean , BeanManagerImpl manager ) { if ( bean instanceof RIBean < ? > ) { return ( ( RIBean < ? > ) bean ) . isProxyable ( ) ; } else { return Proxies . isTypesProxyable ( bean . getTypes ( ) , manager . getServices ( ) ) ; } }
Indicates if a bean is proxyable
150,326
public static boolean containsAllQualifiers ( Set < QualifierInstance > requiredQualifiers , Set < QualifierInstance > qualifiers ) { return qualifiers . containsAll ( requiredQualifiers ) ; }
Checks that all the qualifiers in the set requiredQualifiers are in the set of qualifiers . Qualifier equality rules for annotation members are followed .
150,327
public static < T extends Bean < ? > > Set < T > removeDisabledBeans ( Set < T > beans , final BeanManagerImpl beanManager ) { if ( beans . isEmpty ( ) ) { return beans ; } else { for ( Iterator < T > iterator = beans . iterator ( ) ; iterator . hasNext ( ) ; ) { if ( ! isBeanEnabled ( iterator . next ( ) , beanManager...
Retains only beans which are enabled .
150,328
public static boolean isAlternative ( EnhancedAnnotated < ? , ? > annotated , MergedStereotypes < ? , ? > mergedStereotypes ) { return annotated . isAnnotationPresent ( Alternative . class ) || mergedStereotypes . isAlternative ( ) ; }
Is alternative .
150,329
public static < T > void injectEEFields ( Iterable < Set < ResourceInjection < ? > > > resourceInjectionsHierarchy , T beanInstance , CreationalContext < T > ctx ) { for ( Set < ResourceInjection < ? > > resourceInjections : resourceInjectionsHierarchy ) { for ( ResourceInjection < ? > resourceInjection : resourceInjec...
Injects EJBs and other EE resources .
150,330
public static Type getDeclaredBeanType ( Class < ? > clazz ) { Type [ ] actualTypeArguments = Reflections . getActualTypeArguments ( clazz ) ; if ( actualTypeArguments . length == 1 ) { return actualTypeArguments [ 0 ] ; } else { return null ; } }
Gets the declared bean type
150,331
public static < T > void injectBoundFields ( T instance , CreationalContext < T > creationalContext , BeanManagerImpl manager , Iterable < ? extends FieldInjectionPoint < ? , ? > > injectableFields ) { for ( FieldInjectionPoint < ? , ? > injectableField : injectableFields ) { injectableField . inject ( instance , manag...
Injects bound fields
150,332
public static < T > void callInitializers ( T instance , CreationalContext < T > creationalContext , BeanManagerImpl manager , Iterable < ? extends MethodInjectionPoint < ? , ? > > initializerMethods ) { for ( MethodInjectionPoint < ? , ? > initializer : initializerMethods ) { initializer . invoke ( instance , null , m...
Calls all initializers of the bean
150,333
public static boolean isTypeManagedBeanOrDecoratorOrInterceptor ( AnnotatedType < ? > annotatedType ) { Class < ? > javaClass = annotatedType . getJavaClass ( ) ; return ! javaClass . isEnum ( ) && ! Extension . class . isAssignableFrom ( javaClass ) && Reflections . isTopLevelOrStaticNestedClass ( javaClass ) && ! Ref...
Indicates if the type is a simple Web Bean
150,334
public static < T > NewSessionBean < T > of ( BeanAttributes < T > attributes , InternalEjbDescriptor < T > ejbDescriptor , BeanManagerImpl beanManager ) { EnhancedAnnotatedType < T > type = beanManager . getServices ( ) . get ( ClassTransformer . class ) . getEnhancedAnnotatedType ( ejbDescriptor . getBeanClass ( ) , ...
Creates an instance of a NewEnterpriseBean from an annotated class
150,335
public static < X , T > ProducerField < X , T > of ( BeanAttributes < T > attributes , EnhancedAnnotatedField < T , ? super X > field , AbstractClassBean < X > declaringBean , DisposalMethod < X , ? > disposalMethod , BeanManagerImpl beanManager , ServiceRegistry services ) { return new ProducerField < X , T > ( attrib...
Creates a producer field
150,336
public static boolean hasPermission ( Permission permission ) { SecurityManager security = System . getSecurityManager ( ) ; if ( security != null ) { try { security . checkPermission ( permission ) ; } catch ( java . security . AccessControlException e ) { return false ; } } return true ; }
Determines whether the specified permission is permitted .
150,337
public static < T > ManagedBean < T > of ( BeanAttributes < T > attributes , EnhancedAnnotatedType < T > clazz , BeanManagerImpl beanManager ) { return new ManagedBean < T > ( attributes , clazz , createId ( attributes , clazz ) , beanManager ) ; }
Creates a simple annotation defined Web Bean
150,338
public void destroy ( T instance , CreationalContext < T > creationalContext ) { super . destroy ( instance , creationalContext ) ; try { getProducer ( ) . preDestroy ( instance ) ; if ( creationalContext instanceof CreationalContextImpl ) { ( ( CreationalContextImpl < T > ) creationalContext ) . release ( this , insta...
Destroys an instance of the bean
150,339
protected void checkType ( ) { if ( ! isDependent ( ) && getEnhancedAnnotated ( ) . isParameterizedType ( ) ) { throw BeanLogger . LOG . managedBeanWithParameterizedBeanClassMustBeDependent ( type ) ; } boolean passivating = beanManager . isPassivatingScope ( getScope ( ) ) ; if ( passivating && ! isPassivationCapableB...
Validates the type
150,340
public static < T > Set < T > of ( T ... elements ) { Preconditions . checkNotNull ( elements ) ; return ImmutableSet . < T > builder ( ) . addAll ( elements ) . build ( ) ; }
Creates a new immutable set that consists of given elements .
150,341
Object readResolve ( ) throws ObjectStreamException { Bean < ? > bean = Container . instance ( contextId ) . services ( ) . get ( ContextualStore . class ) . < Bean < Object > , Object > getContextual ( beanId ) ; if ( bean == null ) { throw BeanLogger . LOG . proxyDeserializationFailure ( beanId ) ; } return Container...
Always returns the original proxy object that was serialized .
150,342
protected String getToken ( ) { GetAccessTokenResult token = accessToken . get ( ) ; if ( token == null || isExpired ( token ) || ( isAboutToExpire ( token ) && refreshInProgress . compareAndSet ( false , true ) ) ) { lock . lock ( ) ; try { token = accessToken . get ( ) ; if ( token == null || isAboutToExpire ( token ...
Attempts to return the token from cache . If this is not possible because it is expired or was never assigned a new token is requested and parallel requests will block on retrieving a new token . As such no guarantee of maximum latency is provided .
150,343
private void waitForOutstandingRequest ( ) throws IOException { if ( outstandingRequest == null ) { return ; } try { RetryHelper . runWithRetries ( new Callable < Void > ( ) { public Void call ( ) throws IOException , InterruptedException { if ( RetryHelper . getContext ( ) . getAttemptNumber ( ) > 1 ) { outstandingReq...
Waits for the current outstanding request retrying it with exponential backoff if it fails .
150,344
static Date parseDate ( String dateString ) { try { return DATE_FORMAT . parseDateTime ( dateString ) . toDate ( ) ; } catch ( IllegalArgumentException e ) { return null ; } }
Parses the date or returns null if it fails to do so .
150,345
public Future < RawGcsCreationToken > continueObjectCreationAsync ( final RawGcsCreationToken token , final ByteBuffer chunk , long timeoutMillis ) { try { ensureInitialized ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } final Environment environment = ApiProxy . getCurrentEnvironment ( ) ; retu...
Runs calls in a background thread so that the results will actually be asynchronous .
150,346
private void requestBlock ( ) { next = ByteBuffer . allocate ( blockSizeBytes ) ; long requestTimeout = retryParams . getRequestTimeoutMillisForCurrentAttempt ( ) ; pendingFetch = raw . readObjectAsync ( next , filename , fetchPosition , requestTimeout ) ; }
Allocates a new next buffer and pending fetch .
150,347
GcsRestCreationToken handlePutResponse ( final GcsRestCreationToken token , final boolean isFinalChunk , final int length , final HTTPRequestInfo reqInfo , HTTPResponse resp ) throws Error , IOException { switch ( resp . getResponseCode ( ) ) { case 200 : if ( ! isFinalChunk ) { throw new RuntimeException ( "Unexpected...
Given a HTTPResponce process it throwing an error if needed and return a Token for the next request .
150,348
private RawGcsCreationToken put ( final GcsRestCreationToken token , ByteBuffer chunk , final boolean isFinalChunk , long timeoutMillis ) throws IOException { final int length = chunk . remaining ( ) ; HTTPRequest req = createPutRequest ( token , chunk , isFinalChunk , timeoutMillis , length ) ; HTTPRequestInfo info = ...
Write the provided chunk at the offset specified in the token . If finalChunk is set the file will be closed .
150,349
public boolean deleteObject ( GcsFilename filename , long timeoutMillis ) throws IOException { HTTPRequest req = makeRequest ( filename , null , DELETE , timeoutMillis ) ; HTTPResponse resp ; try { resp = urlfetch . fetch ( req ) ; } catch ( IOException e ) { throw createIOException ( new HTTPRequestInfo ( req ) , e ) ...
True if deleted false if not found .
150,350
public Future < GcsFileMetadata > readObjectAsync ( final ByteBuffer dst , final GcsFilename filename , long startOffsetBytes , long timeoutMillis ) { Preconditions . checkArgument ( startOffsetBytes >= 0 , "%s: offset must be non-negative: %s" , this , startOffsetBytes ) ; final int n = dst . remaining ( ) ; Precondit...
Might not fill all of dst .
150,351
private void copy ( InputStream input , OutputStream output ) throws IOException { try { byte [ ] buffer = new byte [ BUFFER_SIZE ] ; int bytesRead = input . read ( buffer ) ; while ( bytesRead != - 1 ) { output . write ( buffer , 0 , bytesRead ) ; bytesRead = input . read ( buffer ) ; } } finally { input . close ( ) ;...
Transfer the data from the inputStream to the outputStream . Then close both streams .
150,352
public Collection < Locale > getCountries ( ) { Collection < Locale > result = get ( KEY_QUERY_COUNTRIES , Collection . class ) ; if ( result == null ) { return Collections . emptySet ( ) ; } return result ; }
Returns the target locales .
150,353
public Collection < String > getCurrencyCodes ( ) { Collection < String > result = get ( KEY_QUERY_CURRENCY_CODES , Collection . class ) ; if ( result == null ) { return Collections . emptySet ( ) ; } return result ; }
Gets the currency codes or the regular expression to select codes .
150,354
public Collection < Integer > getNumericCodes ( ) { Collection < Integer > result = get ( KEY_QUERY_NUMERIC_CODES , Collection . class ) ; if ( result == null ) { return Collections . emptySet ( ) ; } return result ; }
Gets the numeric codes . Setting it to - 1 search for currencies that have no numeric code .
150,355
public Class < ? extends MonetaryAmount > getAmountType ( ) { Class < ? > clazz = get ( AMOUNT_TYPE , Class . class ) ; return clazz . asSubclass ( MonetaryAmount . class ) ; }
Get the MonetaryAmount implementation class .
150,356
public Set < String > getProviderNames ( ) { Set < String > result = new HashSet < > ( ) ; for ( RoundingProviderSpi prov : Bootstrap . getServices ( RoundingProviderSpi . class ) ) { try { result . add ( prov . getProviderName ( ) ) ; } catch ( Exception e ) { Logger . getLogger ( Monetary . class . getName ( ) ) . lo...
Get the names of all current registered providers .
150,357
public List < String > getDefaultProviderChain ( ) { List < String > result = new ArrayList < > ( Monetary . getRoundingProviderNames ( ) ) ; Collections . sort ( result ) ; return result ; }
Get the default providers list to be used .
150,358
public Set < String > getRoundingNames ( String ... providers ) { Set < String > result = new HashSet < > ( ) ; String [ ] providerNames = providers ; if ( providerNames . length == 0 ) { providerNames = Monetary . getDefaultRoundingProviderChain ( ) . toArray ( new String [ Monetary . getDefaultRoundingProviderChain (...
Allows to access the identifiers of the current defined roundings .
150,359
@ SuppressWarnings ( "unchecked" ) public Set < RateType > getRateTypes ( ) { Set < RateType > result = get ( KEY_RATE_TYPES , Set . class ) ; if ( result == null ) { return Collections . emptySet ( ) ; } return result ; }
Get the rate types set .
150,360
public CurrencyQueryBuilder setCountries ( Locale ... countries ) { return set ( CurrencyQuery . KEY_QUERY_COUNTRIES , Arrays . asList ( countries ) ) ; }
Sets the country for which currencies should be requested .
150,361
public CurrencyQueryBuilder setCurrencyCodes ( String ... codes ) { return set ( CurrencyQuery . KEY_QUERY_CURRENCY_CODES , Arrays . asList ( codes ) ) ; }
Sets the currency code or the regular expression to select codes .
150,362
public CurrencyQueryBuilder setNumericCodes ( int ... codes ) { return set ( CurrencyQuery . KEY_QUERY_NUMERIC_CODES , Arrays . stream ( codes ) . boxed ( ) . collect ( Collectors . toList ( ) ) ) ; }
Set the numeric code . Setting it to - 1 search for currencies that have no numeric code .
150,363
public static List < String > getDefaultConversionProviderChain ( ) { List < String > defaultChain = getMonetaryConversionsSpi ( ) . getDefaultProviderChain ( ) ; Objects . requireNonNull ( defaultChain , "No default provider chain provided by SPI: " + getMonetaryConversionsSpi ( ) . getClass ( ) . getName ( ) ) ; retu...
Get the default provider used .
150,364
public Set < String > getKeys ( Class < ? > type ) { return data . entrySet ( ) . stream ( ) . filter ( val -> type . isAssignableFrom ( val . getValue ( ) . getClass ( ) ) ) . map ( Map . Entry :: getKey ) . collect ( Collectors . toSet ( ) ) ; }
Get the present keys of all entries with a given type checking hereby if assignable .
150,365
public Class < ? > getType ( String key ) { Object val = this . data . get ( key ) ; return val == null ? null : val . getClass ( ) ; }
Get the current attribute type .
150,366
public < T > T get ( String key , Class < T > type ) { Object value = this . data . get ( key ) ; if ( value != null && type . isAssignableFrom ( value . getClass ( ) ) ) { return ( T ) value ; } return null ; }
Access an attribute .
150,367
public < T > T get ( Class < T > type ) { return get ( type . getName ( ) , type ) ; }
Access an attribute hereby using the class name as key .
150,368
@ SuppressWarnings ( "unchecked" ) public B setTargetType ( Class < ? > type ) { Objects . requireNonNull ( type ) ; set ( AbstractQuery . KEY_QUERY_TARGET_TYPE , type ) ; return ( B ) this ; }
Sets the target implementation type required . This can be used to explicitly acquire a specific implementation type and use a query to configure the instance or factory to be returned .
150,369
public Set < RateType > getRateTypes ( ) { @ SuppressWarnings ( "unchecked" ) Set < RateType > rateSet = get ( KEY_RATE_TYPES , Set . class ) ; if ( rateSet == null ) { return Collections . emptySet ( ) ; } return Collections . unmodifiableSet ( rateSet ) ; }
Get the deferred flag . Exchange rates can be deferred or real . time .
150,370
private static MonetaryFormatsSingletonSpi loadMonetaryFormatsSingletonSpi ( ) { try { return Optional . ofNullable ( Bootstrap . getService ( MonetaryFormatsSingletonSpi . class ) ) . orElseGet ( DefaultMonetaryFormatsSingletonSpi :: new ) ; } catch ( Exception e ) { Logger . getLogger ( MonetaryFormats . class . getN...
Loads the SPI backing bean .
150,371
public static Collection < String > getFormatProviderNames ( ) { Collection < String > providers = Optional . ofNullable ( getMonetaryFormatsSpi ( ) ) . orElseThrow ( ( ) -> new MonetaryException ( "No MonetaryFormatsSingletonSpi loaded, query functionality is not available." ) ) . getProviderNames ( ) ; if ( Objects ....
Get the names of the currently registered format providers .
150,372
public ProviderContextBuilder setRateTypes ( Collection < RateType > rateTypes ) { Objects . requireNonNull ( rateTypes ) ; if ( rateTypes . isEmpty ( ) ) { throw new IllegalArgumentException ( "At least one RateType is required." ) ; } Set < RateType > rtSet = new HashSet < > ( rateTypes ) ; set ( ProviderContext . KE...
Set the rate types .
150,373
public B importContext ( AbstractContext context , boolean overwriteDuplicates ) { for ( Map . Entry < String , Object > en : context . data . entrySet ( ) ) { if ( overwriteDuplicates ) { this . data . put ( en . getKey ( ) , en . getValue ( ) ) ; } else { this . data . putIfAbsent ( en . getKey ( ) , en . getValue ( ...
Apply all attributes on the given context .
150,374
public B importContext ( AbstractContext context ) { Objects . requireNonNull ( context ) ; return importContext ( context , false ) ; }
Apply all attributes on the given context hereby existing entries are preserved .
150,375
public B set ( String key , int value ) { this . data . put ( key , value ) ; return ( B ) this ; }
Sets an Integer attribute .
150,376
public static Set < String > getRoundingNames ( String ... providers ) { return Optional . ofNullable ( monetaryRoundingsSingletonSpi ( ) ) . orElseThrow ( ( ) -> new MonetaryException ( "No MonetaryRoundingsSpi loaded, query functionality is not available." ) ) . getRoundingNames ( providers ) ; }
Allows to access the names of the current defined roundings .
150,377
@ SuppressWarnings ( "rawtypes" ) public static MonetaryAmountFactory getAmountFactory ( MonetaryAmountFactoryQuery query ) { return Optional . ofNullable ( monetaryAmountsSingletonQuerySpi ( ) ) . orElseThrow ( ( ) -> new MonetaryException ( "No MonetaryAmountsSingletonQuerySpi loaded, query functionality is not avail...
Executes the query and returns the factory found if there is only one factory . If multiple factories match the query one is selected .
150,378
public static Collection < MonetaryAmountFactory < ? > > getAmountFactories ( MonetaryAmountFactoryQuery query ) { return Optional . ofNullable ( monetaryAmountsSingletonQuerySpi ( ) ) . orElseThrow ( ( ) -> new MonetaryException ( "No MonetaryAmountsSingletonQuerySpi loaded, query functionality is not available." ) ) ...
Returns all factory instances that match the query .
150,379
public static Collection < CurrencyUnit > getCurrencies ( String ... providers ) { return Optional . ofNullable ( MONETARY_CURRENCIES_SINGLETON_SPI ( ) ) . orElseThrow ( ( ) -> new MonetaryException ( "No MonetaryCurrenciesSingletonSpi loaded, check your system setup." ) ) . getCurrencies ( providers ) ; }
Access all currencies known .
150,380
private PoolingHttpClientConnectionManager createConnectionMgr ( ) { PoolingHttpClientConnectionManager connectionMgr ; SSLContext sslContext = buildSslContext ( ) ; ConnectionSocketFactory plainsf = PlainConnectionSocketFactory . getSocketFactory ( ) ; boolean noHostVerification = false ; LayeredConnectionSocketFactor...
Creates custom Http Client connection pool to be used by Http Client
150,381
public ArtifactoryResponse restCall ( ArtifactoryRequest artifactoryRequest ) throws IOException { HttpRequestBase httpRequest ; String requestPath = "/" + artifactoryRequest . getApiUrl ( ) ; ContentType contentType = Util . getContentType ( artifactoryRequest . getRequestType ( ) ) ; String queryPath = "" ; if ( ! ar...
Create a REST call to artifactory with a generic request
150,382
protected void createDocument ( ) throws ParserConfigurationException { DocumentBuilderFactory builderFactory = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder builder = builderFactory . newDocumentBuilder ( ) ; DocumentType doctype = builder . getDOMImplementation ( ) . createDocumentType ( "html" , "-//W3C...
Creates a new empty HTML document tree .
150,383
public void writeText ( PDDocument doc , Writer outputStream ) throws IOException { try { DOMImplementationRegistry registry = DOMImplementationRegistry . newInstance ( ) ; DOMImplementationLS impl = ( DOMImplementationLS ) registry . getDOMImplementation ( "LS" ) ; LSSerializer writer = impl . createLSSerializer ( ) ;...
Parses a PDF document and serializes the resulting DOM tree to an output . This requires a DOM Level 3 capable implementation to be available .
150,384
public Document createDOM ( PDDocument doc ) throws IOException { super . writeText ( doc , new OutputStreamWriter ( System . out ) ) ; return this . doc ; }
Loads a PDF document and creates a DOM tree from it .
150,385
protected Element createPageElement ( ) { String pstyle = "" ; PDRectangle layout = getCurrentMediaBox ( ) ; if ( layout != null ) { float w = layout . getWidth ( ) ; float h = layout . getHeight ( ) ; final int rot = pdpage . getRotation ( ) ; if ( rot == 90 || rot == 270 ) { float x = w ; w = h ; h = x ; } pstyle = "...
Creates an element that represents a single page .
150,386
protected Element createTextElement ( float width ) { Element el = doc . createElement ( "div" ) ; el . setAttribute ( "id" , "p" + ( textcnt ++ ) ) ; el . setAttribute ( "class" , "p" ) ; String style = curstyle . toString ( ) ; style += "width:" + width + UNIT + ";" ; el . setAttribute ( "style" , style ) ; return el...
Creates an element that represents a single positioned box with no content .
150,387
protected Element createTextElement ( String data , float width ) { Element el = createTextElement ( width ) ; Text text = doc . createTextNode ( data ) ; el . appendChild ( text ) ; return el ; }
Creates an element that represents a single positioned box containing the specified text string .
150,388
protected Element createRectangleElement ( float x , float y , float width , float height , boolean stroke , boolean fill ) { float lineWidth = transformWidth ( getGraphicsState ( ) . getLineWidth ( ) ) ; float wcor = stroke ? lineWidth : 0.0f ; float strokeOffset = wcor == 0 ? 0 : wcor / 2 ; width = width - wcor < 0 ?...
Creates an element that represents a rectangle drawn at the specified coordinates in the page .
150,389
protected Element createLineElement ( float x1 , float y1 , float x2 , float y2 ) { HtmlDivLine line = new HtmlDivLine ( x1 , y1 , x2 , y2 ) ; String color = colorString ( getGraphicsState ( ) . getStrokingColor ( ) ) ; StringBuilder pstyle = new StringBuilder ( 50 ) ; pstyle . append ( "left:" ) . append ( style . for...
Create an element that represents a horizntal or vertical line .
150,390
protected Element createImageElement ( float x , float y , float width , float height , ImageResource resource ) throws IOException { StringBuilder pstyle = new StringBuilder ( "position:absolute;" ) ; pstyle . append ( "left:" ) . append ( x ) . append ( UNIT ) . append ( ';' ) ; pstyle . append ( "top:" ) . append ( ...
Creates an element that represents an image drawn at the specified coordinates in the page .
150,391
protected String createGlobalStyle ( ) { StringBuilder ret = new StringBuilder ( ) ; ret . append ( createFontFaces ( ) ) ; ret . append ( "\n" ) ; ret . append ( defaultStyle ) ; return ret . toString ( ) ; }
Generate the global CSS style for the whole document .
150,392
public void createPdfLayout ( Dimension dim ) { if ( pdfdocument != null ) { try { if ( createImage ) img = new BufferedImage ( dim . width , dim . height , BufferedImage . TYPE_INT_RGB ) ; Graphics2D ig = img . createGraphics ( ) ; log . info ( "Creating PDF boxes" ) ; VisualContext ctx = new VisualContext ( null , nu...
Creates the box tree for the PDF file .
150,393
protected BlockBox createBlock ( BlockBox parent , Element n , boolean replaced ) { BlockBox root ; if ( replaced ) { BlockReplacedBox rbox = new BlockReplacedBox ( ( Element ) n , ( Graphics2D ) parent . getGraphics ( ) . create ( ) , parent . getVisualContext ( ) . create ( ) ) ; rbox . setViewport ( viewport ) ; rbo...
Creates a new block box from the given element with the given parent . No style is assigned to the resulting box .
150,394
protected TextBox createTextBox ( BlockBox contblock , Text n ) { TextBox text = new TextBox ( n , ( Graphics2D ) contblock . getGraphics ( ) . create ( ) , contblock . getVisualContext ( ) . create ( ) ) ; text . setOrder ( next_order ++ ) ; text . setContainingBlockBox ( contblock ) ; text . setClipBlock ( contblock ...
Creates a text box with the given parent and text node assigned .
150,395
protected NodeData createBlockStyle ( ) { NodeData ret = CSSFactory . createNodeData ( ) ; TermFactory tf = CSSFactory . getTermFactory ( ) ; ret . push ( createDeclaration ( "display" , tf . createIdent ( "block" ) ) ) ; return ret ; }
Creates an empty block style definition .
150,396
protected NodeData createBodyStyle ( ) { NodeData ret = createBlockStyle ( ) ; TermFactory tf = CSSFactory . getTermFactory ( ) ; ret . push ( createDeclaration ( "background-color" , tf . createColor ( 255 , 255 , 255 ) ) ) ; return ret ; }
Creates a style definition used for the body element .
150,397
protected NodeData createPageStyle ( ) { NodeData ret = createBlockStyle ( ) ; TermFactory tf = CSSFactory . getTermFactory ( ) ; ret . push ( createDeclaration ( "position" , tf . createIdent ( "relative" ) ) ) ; ret . push ( createDeclaration ( "border-width" , tf . createLength ( 1f , Unit . px ) ) ) ; ret . push ( ...
Creates a style definition used for pages .
150,398
protected NodeData createRectangleStyle ( float x , float y , float width , float height , boolean stroke , boolean fill ) { float lineWidth = transformLength ( ( float ) getGraphicsState ( ) . getLineWidth ( ) ) ; float lw = ( lineWidth < 1f ) ? 1f : lineWidth ; float wcor = stroke ? lw : 0.0f ; NodeData ret = CSSFact...
Creates the style definition used for a rectangle element based on the given properties of the rectangle
150,399
protected Declaration createDeclaration ( String property , Term < ? > term ) { Declaration d = CSSFactory . getRuleFactory ( ) . createDeclaration ( ) ; d . unlock ( ) ; d . setProperty ( property ) ; d . add ( term ) ; return d ; }
Creates a single property declaration .