idx
int64
0
41.2k
question
stringlengths
83
4.15k
target
stringlengths
5
715
12,300
public static final KeyPressHandler getNumericAndUpperAsciiKeyPressHandler ( ) { if ( HandlerFactory . numericAndUpperAsciiKeyPressHandler == null ) { synchronized ( NumericAndUpperAsciiKeyPressHandler . class ) { if ( HandlerFactory . numericAndUpperAsciiKeyPressHandler == null ) { HandlerFactory . numericAndUpperAsci...
get a numeric and upper case key press handler .
12,301
public static final KeyPressHandler getNumericKeyPressHandler ( ) { if ( HandlerFactory . numericKeyPressHandler == null ) { synchronized ( NumericKeyPressHandler . class ) { if ( HandlerFactory . numericKeyPressHandler == null ) { HandlerFactory . numericKeyPressHandler = new NumericKeyPressHandler ( ) ; } } } return ...
get a numeric key press handler .
12,302
public static final KeyPressHandler getNumericWithSeparatorsKeyPressHandler ( ) { if ( HandlerFactory . numericWsKeyPressHandler == null ) { synchronized ( NumericWithSeparatorsKeyPressHandler . class ) { if ( HandlerFactory . numericWsKeyPressHandler == null ) { HandlerFactory . numericWsKeyPressHandler = new NumericW...
get a numeric with separators key press handler .
12,303
public static final KeyPressHandler getCurrencyKeyPressHandler ( ) { if ( HandlerFactory . currencyKeyPressHandler == null ) { synchronized ( CurrencyKeyPressHandler . class ) { if ( HandlerFactory . currencyKeyPressHandler == null ) { HandlerFactory . currencyKeyPressHandler = new CurrencyKeyPressHandler ( ) ; } } } r...
get a currency key press handler .
12,304
public static final KeyPressHandler getPercentKeyPressHandler ( ) { if ( HandlerFactory . percentKeyPressHandler == null ) { synchronized ( PercentKeyPressHandler . class ) { if ( HandlerFactory . percentKeyPressHandler == null ) { HandlerFactory . percentKeyPressHandler = new PercentKeyPressHandler ( ) ; } } } return ...
get a percent key press handler .
12,305
public static final KeyPressHandler getPhoneNumberKeyPressHandler ( ) { if ( HandlerFactory . phoneNumberKeyPressHandler == null ) { synchronized ( PhoneNumberKeyPressHandler . class ) { if ( HandlerFactory . phoneNumberKeyPressHandler == null ) { HandlerFactory . phoneNumberKeyPressHandler = new PhoneNumberKeyPressHan...
get a phone number key press handler .
12,306
public static final KeyPressHandler getDecimalKeyPressHandler ( ) { if ( HandlerFactory . decimalKeyPressHandler == null ) { synchronized ( DecimalKeyPressHandler . class ) { if ( HandlerFactory . decimalKeyPressHandler == null ) { HandlerFactory . decimalKeyPressHandler = new DecimalKeyPressHandler ( ) ; } } } return ...
get a decimal key press handler .
12,307
public static final KeyPressHandler getRegExKeyPressHandler ( final String pregEx ) { if ( StringUtils . isEmpty ( pregEx ) ) { return null ; } RegExKeyPressHandler result = HandlerFactory . REG_EX_KEY_PRESS_HANDLER_MAP . get ( pregEx ) ; if ( result == null ) { result = new RegExKeyPressHandler ( pregEx ) ; } return r...
get a key press handler which allows all characters which could match a reg ex .
12,308
public static final KeyPressHandler getFilterReplAndFormatStrKeyPressHandler ( ) { if ( HandlerFactory . filReplFormStrKeyPrH == null ) { synchronized ( DecimalKeyPressHandler . class ) { if ( HandlerFactory . filReplFormStrKeyPrH == null ) { HandlerFactory . filReplFormStrKeyPrH = new FilterReplaceAndFormatKeyPressHan...
get a filter replace and format String key press handler .
12,309
public static final KeyUpHandler getFormatStrKeyUpHandler ( ) { if ( HandlerFactory . formatStrKeyUpHandler == null ) { synchronized ( DecimalKeyPressHandler . class ) { if ( HandlerFactory . formatStrKeyUpHandler == null ) { HandlerFactory . formatStrKeyUpHandler = new FormatKeyUpHandler < > ( ) ; } } } return Handler...
get a format key up handler .
12,310
public String asString ( ) { final StringBuilder builder = new StringBuilder ( ) ; boolean first = true ; for ( int i = 1 ; i < this . nodeList . size ( ) ; i ++ ) { final NodeImpl nodeImpl = ( NodeImpl ) this . nodeList . get ( i ) ; final String name = nodeImpl . asString ( ) ; if ( name . isEmpty ( ) ) { continue ; ...
serialize as string .
12,311
public < T extends BaseProxy > T create ( final Class < T > clazz ) { this . checkLocked ( ) ; final SimpleProxyId < T > id = this . state . requestFactory . allocateId ( clazz ) ; final AutoBean < T > created = this . createProxy ( clazz , id , false ) ; return this . takeOwnership ( created ) ; }
Create a new object with an ephemeral id .
12,312
public < T extends BaseProxy > T editProxy ( final T object ) { AutoBean < T > bean = this . checkStreamsNotCrossed ( object ) ; this . checkLocked ( ) ; @ SuppressWarnings ( "unchecked" ) final AutoBean < T > previouslySeen = ( AutoBean < T > ) this . state . editedProxies . get ( BaseProxyCategory . stableId ( bean )...
Take ownership of a proxy instance and make it editable .
12,313
public void fire ( ) { boolean needsReceiver = true ; for ( final AbstractRequest < ? , ? > request : this . state . invocations ) { if ( request . hasReceiver ( ) ) { needsReceiver = false ; break ; } } if ( needsReceiver ) { this . doFire ( new Receiver < Void > ( ) { public void onSuccess ( final Void response ) { }...
Make sure there s a default receiver so errors don t get dropped . This behavior should be revisited when chaining is supported depending on whether or not chained invocations can fail independently .
12,314
protected < T extends BaseProxy > AutoBean < T > createProxy ( final Class < T > clazz , final SimpleProxyId < T > id , final boolean useAppendedContexts ) { AutoBean < T > created = null ; if ( useAppendedContexts ) { for ( final AbstractRequestContext ctx : this . state . appendedContexts ) { created = ctx . getAutoB...
Creates a new proxy with an assigned ID .
12,315
SimpleProxyId < BaseProxy > getId ( final IdMessage op ) { if ( Strength . SYNTHETIC . equals ( op . getStrength ( ) ) ) { return this . allocateSyntheticId ( op . getTypeToken ( ) , op . getSyntheticId ( ) ) ; } return this . state . requestFactory . getId ( op . getTypeToken ( ) , op . getServerId ( ) , op . getClien...
Resolves an IdMessage into an SimpleProxyId .
12,316
< Q extends BaseProxy > AutoBean < Q > getProxyForReturnPayloadGraph ( final SimpleProxyId < Q > id ) { @ SuppressWarnings ( "unchecked" ) AutoBean < Q > bean = ( AutoBean < Q > ) this . state . returnedProxies . get ( id ) ; if ( bean == null ) { final Class < Q > proxyClass = id . getProxyClass ( ) ; bean = this . cr...
Creates or retrieves a new canonical AutoBean to represent the given id in the returned payload .
12,317
AutoBean < OperationMessage > makeOperationMessage ( final SimpleProxyId < BaseProxy > stableId , final AutoBean < ? > proxyBean , final boolean useDelta ) { final AutoBean < OperationMessage > toReturn = MessageFactoryHolder . FACTORY . operation ( ) ; final OperationMessage operation = toReturn . as ( ) ; operation ....
Create a single OperationMessage that encapsulates the state of a proxy AutoBean .
12,318
< Q extends BaseProxy > Q processReturnOperation ( final SimpleProxyId < Q > id , final OperationMessage op , final WriteOperation ... operations ) { final AutoBean < Q > toMutate = this . getProxyForReturnPayloadGraph ( id ) ; toMutate . setTag ( Constants . VERSION_PROPERTY_B64 , op . getVersion ( ) ) ; final Map < S...
Create a new EntityProxy from a snapshot in the return payload .
12,319
private < Q extends BaseProxy > SimpleProxyId < Q > allocateSyntheticId ( final String typeToken , final int syntheticId ) { @ SuppressWarnings ( "unchecked" ) SimpleProxyId < Q > toReturn = ( SimpleProxyId < Q > ) this . state . syntheticIds . get ( syntheticId ) ; if ( toReturn == null ) { toReturn = this . state . r...
Get - or - create method for synthetic ids .
12,320
private < T > AutoBean < T > checkStreamsNotCrossed ( final T object ) { final AutoBean < T > bean = AutoBeanUtils . getAutoBean ( object ) ; if ( bean == null ) { throw new IllegalArgumentException ( object . getClass ( ) . getName ( ) ) ; } final State otherState = bean . getTag ( REQUEST_CONTEXT_STATE ) ; if ( ! bea...
This method checks that a proxy object is either immutable or already edited by this context .
12,321
private void freezeEntities ( final boolean frozen ) { for ( final AutoBean < ? > bean : this . state . editedProxies . values ( ) ) { bean . setFrozen ( frozen ) ; } }
Set the frozen status of all EntityProxies owned by this context .
12,322
private void makeImmutable ( final AutoBean < ? extends BaseProxy > toMutate ) { toMutate . setTag ( Constants . PARENT_OBJECT , toMutate ) ; toMutate . setTag ( REQUEST_CONTEXT_STATE , null ) ; toMutate . setFrozen ( true ) ; }
Make an EntityProxy immutable .
12,323
private List < InvocationMessage > makePayloadInvocations ( ) { final MessageFactory f = MessageFactoryHolder . FACTORY ; final List < InvocationMessage > invocationMessages = new ArrayList < > ( ) ; for ( final AbstractRequest < ? , ? > invocation : this . state . invocations ) { final RequestData data = invocation . ...
Create an InvocationMessage for each remote method call being made by the context .
12,324
private void processReturnOperations ( final ResponseMessage response ) { final List < OperationMessage > ops = response . getOperations ( ) ; if ( ops == null ) { return ; } for ( final OperationMessage op : ops ) { final SimpleProxyId < ? > id = this . getId ( op ) ; WriteOperation [ ] toPropagate = null ; final Writ...
Process an array of OperationMessages .
12,325
private void retainArg ( final Object arg ) { if ( arg instanceof Iterable < ? > ) { for ( final Object o : ( Iterable < ? > ) arg ) { this . retainArg ( o ) ; } } else if ( arg instanceof BaseProxy ) { this . edit ( ( BaseProxy ) arg ) ; } }
Ensures that any method arguments are retained in the context s sphere of influence .
12,326
private < T extends BaseProxy > T takeOwnership ( final AutoBean < T > bean ) { this . state . editedProxies . put ( stableId ( bean ) , bean ) ; bean . setTag ( REQUEST_CONTEXT_STATE , this . state ) ; return bean . as ( ) ; }
Make the EnityProxy bean edited and owned by this RequestContext .
12,327
public void showErrors ( final Set < String > messages ) { final InputElement inputElement = this . getInputElement ( ) ; if ( messages . isEmpty ( ) ) { if ( FeatureCheck . supportCustomValidity ( inputElement ) ) { inputElement . setCustomValidity ( StringUtils . EMPTY ) ; } if ( this . validationMessageElement == nu...
show error messages .
12,328
public void readSessionData ( ) { this . dispatcher . execute ( this . userService . isCurrentUserLoggedIn ( ) , new AbstractSimpleRestCallback < GwtpSpringSession < T > , Boolean , HttpMessages > ( this , this ) { public void onSuccess ( final Boolean presult ) { if ( BooleanUtils . isTrue ( presult ) ) { GwtpSpringSe...
read session data .
12,329
@ GwtIncompatible ( "incompatible method" ) @ SuppressWarnings ( "unchecked" ) public static < T > T findValueOfType ( final Collection < ? > collection , final Class < T > type ) { if ( CollectionUtils . isEmpty ( collection ) ) { return null ; } T value = null ; for ( final Object element : collection ) { if ( type =...
Find a single value of the given type in the given Collection .
12,330
public static < T > T lastElement ( final List < T > list ) { if ( CollectionUtils . isEmpty ( list ) ) { return null ; } return list . get ( list . size ( ) - 1 ) ; }
Retrieve the last element of the given List accessing the highest index .
12,331
@ SuppressWarnings ( "unchecked" ) public static < K , V > MultiValueMap < K , V > unmodifiableMultiValueMap ( final MultiValueMap < ? extends K , ? extends V > map ) { Assert . notNull ( map , "'map' must not be null" ) ; final Map < K , List < V > > result = new LinkedHashMap < > ( map . size ( ) ) ; map . forEach ( ...
Return an unmodifiable view of the specified multi - value map .
12,332
BeanHelper createHelper ( final JClassType pjtype , final TreeLogger plogger , final GeneratorContext pcontext ) throws UnableToCompleteException { final JClassType erasedType = pjtype . getErasedType ( ) ; try { final Class < ? > clazz = Class . forName ( erasedType . getQualifiedBinaryName ( ) ) ; return doCreateHelp...
Creates a BeanHelper and writes an interface containing its instance . Also recursively creates any BeanHelpers on its constrained properties .
12,333
private void doCreateHelperForProp ( final PropertyDescriptor propertyDescriptor , final BeanHelper parent , final TreeLogger logger , final GeneratorContext context ) throws UnableToCompleteException { final Class < ? > elementClass = propertyDescriptor . getElementClass ( ) ; if ( GwtSpecificValidatorCreator . isIter...
Creates the appropriate BeanHelper for a property on a bean .
12,334
private void generateMapRecursive ( final List < NavigationEntryInterface > pnavigationEntries ) { for ( final NavigationEntryInterface entryToAdd : pnavigationEntries ) { String token = entryToAdd . getToken ( ) ; if ( entryToAdd . getMenuValue ( ) != null && token != null ) { if ( token . endsWith ( "/" + StringUtils...
create map out of the navigation list .
12,335
private List < NavigationEntryInterface > recursiveGetEntries ( final List < NavigationEntryInterface > pnavigationEntries ) { if ( pnavigationEntries == null ) { return Collections . emptyList ( ) ; } return pnavigationEntries . stream ( ) . filter ( entry -> entry . canReveal ( ) ) . map ( entry -> { if ( entry insta...
get all navigation entries that can be displayed by a given user .
12,336
public static < T > ConstraintViolation < T > forReturnValueValidation ( final String messageTemplate , final Map < String , Object > messageParameters , final Map < String , Object > expressionVariables , final String interpolatedMessage , final Class < T > rootBeanClass , final T rootBean , final Object leafBeanInsta...
create ConstraintViolation for return value validation .
12,337
private int createHashCode ( ) { return Objects . hash ( this . interpolatedMessage , this . propertyPath , this . rootBean , this . leafBeanInstance , this . value , this . constraintDescriptor , this . messageTemplate , this . elementType ) ; }
create hash code .
12,338
private void initFromAttributes ( Context context , AttributeSet attrs , int defStyleAttr , int defStyleRes ) { TypedArray a = context . obtainStyledAttributes ( attrs , R . styleable . JCropImageView , defStyleAttr , defStyleRes ) ; mCropType = a . getInt ( R . styleable . JCropImageView_cropType , mCropType ) ; mCrop...
Initialize the attributes for JCropImageView
12,339
public void await ( long timeout , TimeUnit unit ) throws InterruptedException , TimeoutException { if ( ! latch . await ( timeout , unit ) ) { throw new TimeoutException ( ) ; } }
Waits for the CallFuture to complete without returning the result .
12,340
public static < T > HashSet < T > newHashSet ( final Iterable < ? extends T > iterable ) { final HashSet < T > set = newHashSet ( ) ; for ( final T t : iterable ) { set . add ( t ) ; } return set ; }
new has set from iterable .
12,341
public static < T > ArrayList < T > newArrayList ( final Iterable < T > ... iterables ) { final ArrayList < T > resultList = newArrayList ( ) ; for ( final Iterable < T > oneIterable : iterables ) { for ( final T oneElement : oneIterable ) { resultList . add ( oneElement ) ; } } return resultList ; }
new array list from iterable .
12,342
public static < T > List < T > toImmutableList ( final List < ? extends T > list ) { switch ( list . size ( ) ) { case 0 : return Collections . emptyList ( ) ; case 1 : return Collections . singletonList ( list . get ( 0 ) ) ; default : return Collections . unmodifiableList ( list ) ; } }
list to imuteable list .
12,343
public static < T > Set < T > toImmutableSet ( final Set < ? extends T > set ) { switch ( set . size ( ) ) { case 0 : return Collections . emptySet ( ) ; case 1 : return Collections . singleton ( set . iterator ( ) . next ( ) ) ; default : return Collections . unmodifiableSet ( set ) ; } }
list to imuteable set .
12,344
public static < K , V > Map < K , V > toImmutableMap ( final Map < K , V > map ) { switch ( map . size ( ) ) { case 0 : return Collections . emptyMap ( ) ; case 1 : final Entry < K , V > entry = map . entrySet ( ) . iterator ( ) . next ( ) ; return Collections . singletonMap ( entry . getKey ( ) , entry . getValue ( ) ...
list to imuteable map .
12,345
protected static PhoneCountryConstantsImpl createPhoneCountryConstants ( final Locale plocale ) { final Map < String , String > phoneCountryNames = CreatePhoneCountryConstantsClass . readPhoneCountryNames ( plocale ) ; final Map < String , String > phoneCountryCodes = CreatePhoneCountryConstantsClass . readPhoneCountry...
NOPMD can t include abstract static methods
12,346
public static String RToSqlUdf ( List < String > RExps , List < String > selectedColumns , List < Column > existingColumns ) { List < String > udfs = Lists . newArrayList ( ) ; Map < String , String > newColToDef = new HashMap < String , String > ( ) ; boolean updateOnConflict = ( selectedColumns == null || selectedCol...
Parse R transform expression to Hive equivalent
12,347
public static List < String > getCurrentRevisionIDs ( Document doc ) throws ForestException { List < String > currentRevIDs = new ArrayList < String > ( ) ; do { currentRevIDs . add ( doc . getSelectedRevID ( ) ) ; } while ( doc . selectNextLeaf ( false , false ) ) ; return currentRevIDs ; }
Not include deleted leaf node
12,348
public final void addSubEntries ( final Collection < NavigationEntryInterface > psubEntries ) { if ( ! CollectionUtils . isEmpty ( psubEntries ) ) { subEntries . addAll ( psubEntries ) ; subEntries . forEach ( subEntry -> subEntry . setParentEntry ( this ) ) ; } }
add a menu sub entries .
12,349
public static Locale convertLanguageToLocale ( final String planguage ) { final Locale locale ; if ( planguage == null ) { locale = null ; } else { final String localeStringUp = planguage . toUpperCase ( ) . replace ( '-' , '_' ) ; if ( LocaleUtil . DEFAULT_MAP . containsKey ( localeStringUp ) ) { locale = LocaleUtil ....
convert language string to Locale .
12,350
public static String locateDirectory ( String dirName ) throws IOException { if ( Utils . dirExists ( dirName ) ) return dirName ; String path = null ; String curDir = new File ( "." ) . getCanonicalPath ( ) ; for ( int i = 0 ; i < 10 ; i ++ ) { path = String . format ( "%s/%s" , curDir , dirName ) ; if ( Utils . dirEx...
Locates the given dirName as a full path in the current directory or in successively higher parent directory above .
12,351
public static String getBankNumberOfIban ( final String pstring ) { final String compressedIban = ibanCompress ( pstring ) ; final String country = StringUtils . substring ( compressedIban , 0 , 2 ) ; final IbanLengthDefinition length = IBAN_LENGTH_MAP . ibanLengths ( ) . get ( country ) ; return length == null ? null ...
get bank number of iban .
12,352
public static String getAccountNumberOfIban ( final String pstring ) { final String compressedIban = ibanCompress ( pstring ) ; final String country = StringUtils . substring ( compressedIban , 0 , 2 ) ; final IbanLengthDefinition length = IBAN_LENGTH_MAP . ibanLengths ( ) . get ( country ) ; return length == null ? nu...
get account number of iban .
12,353
public static String getBicOfIban ( final String pstring ) { final String country = StringUtils . substring ( pstring , 0 , 2 ) ; final String bankNumber = getBankNumberOfIban ( pstring ) ; return BANK_ACCOINT_BIC_MAP . bankAccounts ( ) . get ( new CountryBankAccountData ( country , bankNumber ) ) ; }
get bic of iban .
12,354
protected void addURL ( final URL url ) { final URL [ ] newUrls = new URL [ this . urls . length + 1 ] ; System . arraycopy ( url , 0 , newUrls , 0 , this . urls . length ) ; newUrls [ this . urls . length ] = url ; this . urls = newUrls ; }
Included here so attempts at reflection succeed
12,355
public static String asLiteral ( final Object value ) throws IllegalArgumentException { final Class < ? > clazz = value . getClass ( ) ; if ( clazz . isArray ( ) ) { final StringBuilder sb = new StringBuilder ( ) ; final Object [ ] array = ( Object [ ] ) value ; sb . append ( "new " + clazz . getComponentType ( ) . get...
Returns the literal value of an object that is suitable for inclusion in Java Source code .
12,356
public static boolean isIterableOrMap ( final Class < ? > elementClass ) { return elementClass . isArray ( ) || Iterable . class . isAssignableFrom ( elementClass ) || Map . class . isAssignableFrom ( elementClass ) ; }
check if elementClass is iterable .
12,357
static < T extends Annotation > Class < ? > getTypeOfConstraintValidator ( final Class < ? extends ConstraintValidator < T , ? > > constraintClass ) { int candidateCount = 0 ; Class < ? > result = null ; for ( final Method method : constraintClass . getMethods ( ) ) { if ( method . getName ( ) . equals ( "isValid" ) &&...
Finds the type that a constraint validator will check .
12,358
private void writeValidatorCall ( final SourceWriter sw , final Class < ? > type , final Stage stage , final PropertyDescriptor ppropertyDescription , final boolean expandDefaultGroupSequence , final String groupsVarName ) throws UnableToCompleteException { if ( cache . isClassConstrained ( type ) && ! isIterableOrMap ...
write validator call .
12,359
public static boolean containsElement ( final Object [ ] array , final Object element ) { if ( array == null ) { return false ; } for ( final Object arrayEle : array ) { if ( ObjectUtils . nullSafeEquals ( arrayEle , element ) ) { return true ; } } return false ; }
Check whether the given array contains the given element .
12,360
public static boolean containsConstant ( final Enum < ? > [ ] enumValues , final String constant ) { return ObjectUtils . containsConstant ( enumValues , constant , false ) ; }
Check whether the given array of enum constants contains a constant with the given name ignoring case when determining a match .
12,361
public static boolean containsConstant ( final Enum < ? > [ ] enumValues , final String constant , final boolean caseSensitive ) { for ( final Enum < ? > candidate : enumValues ) { if ( caseSensitive ? candidate . toString ( ) . equals ( constant ) : candidate . toString ( ) . equalsIgnoreCase ( constant ) ) { return t...
Check whether the given array of enum constants contains a constant with the given name .
12,362
public boolean removeColumn ( String name ) { if ( getColumnIndex ( name ) < 0 ) return false ; this . mColumns . remove ( getColumnIndex ( name ) ) ; return true ; }
Remove a column by its name
12,363
public boolean removeColumn ( int i ) { if ( getColumn ( i ) == null ) return false ; this . mColumns . remove ( i ) ; return true ; }
Remove a column by its index
12,364
@ UiChild ( limit = 1 , tagname = "label" ) public void setChildLabel ( final Widget plabel ) { label = plabel ; getLayout ( ) . add ( label ) ; }
Set the label of widget .
12,365
public static < T , E extends Editor < ? super T > > ListValidationEditor < T , E > of ( final EditorSource < E > source ) { return new ListValidationEditor < > ( source ) ; }
Create a ListEditor backed by an EditorSource .
12,366
public static < T > Collection < T > getAllBeansOfType ( WeldContainer weldContainer , Class < T > type ) { Collection < T > beans = Lists . newArrayList ( ) ; Set < Bean < ? > > cdiBeans = weldContainer . getBeanManager ( ) . getBeans ( type , AnyLiteral . INSTANCE ) ; for ( Bean < ? > b : cdiBeans ) { @ SuppressWarni...
Searches the container for all beans of a certain type without respecting qualifiers .
12,367
public static PathImpl instantiate ( final SerializationStreamReader streamReader ) throws SerializationException { final String propertyPath = streamReader . readString ( ) ; return PathImpl . createPathFromString ( propertyPath ) ; }
instantiate a path implementation .
12,368
public static String delete ( final String inString , final String pattern ) { return StringUtils . replace ( inString , pattern , "" ) ; }
Delete all occurrences of the given substring .
12,369
public void setFor ( final IsWidget target ) { if ( init ) { return ; } init = true ; final InputElement input = getInputElement ( target . asWidget ( ) ) ; if ( input != null ) { if ( ! input . hasAttribute ( "id" ) ) { input . setId ( DOM . createUniqueId ( ) ) ; } getElement ( ) . setAttribute ( "for" , input . getI...
set widget to reference to .
12,370
public PMMLPlanner setRetainOnlyActiveFields ( ) { Evaluator evaluator = getEvaluator ( ) ; Fields incomingFields = new Fields ( ) . append ( FieldsUtil . getActiveFields ( evaluator ) ) . append ( FieldsUtil . getGroupFields ( evaluator ) ) ; return setRetainedFields ( incomingFields ) ; }
Orders the retention of only those incoming fields that represent PMML function argument fields .
12,371
public Set < MessageAndPath > getMessageAndPaths ( ) { if ( ! this . disableDefault ) { this . messages . add ( new MessageAndPath ( this . basePath , this . getDefaultConstraintMessageTemplate ( ) ) ) ; } return this . messages ; }
getter for message and path .
12,372
Map < String , String > parseQueryString ( final String queryString , final Map < String , String > into ) { final Map < String , String > result = ( into == null ) ? new HashMap < > ( ) : into ; if ( StringUtils . isNotEmpty ( queryString ) ) { for ( final String keyValuePair : queryString . split ( "&" ) ) { final St...
Parse the given query - string and store all parameters into a map .
12,373
protected final String parseAndFormatDate ( final String pversionDate ) { Date date ; if ( StringUtils . isEmpty ( pversionDate ) ) { date = new Date ( ) ; } else { try { date = versionDateFormat . parse ( pversionDate ) ; } catch ( final IllegalArgumentException e ) { date = new Date ( ) ; } } return dateFormatDisplay...
parse and format a date string .
12,374
public T get ( ) throws IllegalStateException { switch ( this . state ) { case INCOMPLETE : throw new IllegalStateException ( "The server response did not yet recieved." ) ; case FAILED : throw new IllegalStateException ( this . error ) ; case SUCCEEDED : return this . value ; default : throw new IllegalStateException ...
get result of the call .
12,375
public TextBoxBase getTextBox ( ) { if ( getTakesValues ( ) instanceof SuggestBox ) { return ( TextBoxBase ) ( ( SuggestBox ) getTakesValues ( ) ) . getValueBox ( ) ; } return null ; }
get text box .
12,376
public ValueBoxBase < String > getValueBox ( ) { if ( getTakesValues ( ) instanceof SuggestBox ) { return ( ( SuggestBox ) getTakesValues ( ) ) . getValueBox ( ) ; } return null ; }
get value box base .
12,377
public static String [ ] getArgsTypeNameArray ( Class < ? > [ ] argsTypes ) { String [ ] argsTypeArray = null ; if ( argsTypes != null ) { argsTypeArray = new String [ argsTypes . length ] ; for ( int i = 0 ; i < argsTypes . length ; i ++ ) { argsTypeArray [ i ] = argsTypes [ i ] . getName ( ) ; } } return argsTypeArra...
Get parameter type name array from a method
12,378
public static String getArgsTypeName ( String [ ] argTypes ) { if ( argTypes != null ) { return StringUtil . join ( argTypes , ',' ) ; } return StringUtil . EMPTY ; }
Get parameter type name string from a arg types string array
12,379
@ SuppressWarnings ( "unchecked" ) public Iterable < ConstraintViolation < ? > > convert ( final ValidationResultInterface psource , final E pbean ) { if ( psource == null ) { return null ; } return psource . getValidationErrorSet ( ) . stream ( ) . map ( violation -> ConstraintViolationImpl . forBeanValidation ( null ...
convert ValidationResultData from server to a ArrayList&lt ; ConstraintViolation&lt ; ?&gt ; &gt ; which can be handled by gwt .
12,380
public static String escapeMessageParameter ( final String messageParameter ) { if ( messageParameter == null ) { return null ; } return ESCAPE_MESSAGE_PARAMETER_PATTERN . replace ( messageParameter , String . valueOf ( ESCAPE_CHARACTER ) + "$1" ) ; }
escape message parameter .
12,381
public static String syncRestCall ( final String purl ) { try { return CACHE . get ( purl ) ; } catch ( final ExecutionException e ) { GWT . log ( e . getMessage ( ) , e ) ; return null ; } }
start get rest call with given url .
12,382
private static String syncRestNativeCall ( final String purl ) { final XMLHttpRequest xmlHttp = Browser . getWindow ( ) . newXMLHttpRequest ( ) ; xmlHttp . open ( "GET" , purl , false ) ; xmlHttp . send ( ) ; return xmlHttp . getResponseText ( ) ; }
simple synchronous rest get call
12,383
public IModel train ( String trainMethodName , Object ... paramArgs ) throws DDFException { if ( paramArgs == null ) paramArgs = new Object [ 0 ] ; String mappedName = Config . getValueWithGlobalDefault ( this . getEngine ( ) , trainMethodName ) ; if ( ! Strings . isNullOrEmpty ( mappedName ) ) trainMethodName = mapped...
Runs a training algorithm on the entire DDF dataset .
12,384
@ SuppressWarnings ( "unchecked" ) protected ValueBoxBase < E > getTextBoxFromEvent ( final GwtEvent < ? > pevent ) { final ValueBoxBase < E > ptextBox ; if ( pevent . getSource ( ) instanceof SuggestBox ) { ptextBox = ( ValueBoxBase < E > ) ( ( SuggestBox ) pevent . getSource ( ) ) . getValueBox ( ) ; } else if ( peve...
get ValueBoxBase which produced the event .
12,385
public User getLoggedInUser ( ) { User user = null ; final Authentication authentication = SecurityContextHolder . getContext ( ) . getAuthentication ( ) ; if ( authentication != null ) { final Object principal = authentication . getPrincipal ( ) ; if ( principal instanceof UserDetails ) { user = userDetailsConverter ....
get logged in user .
12,386
public Configuration loadConfig ( ) throws ConfigurationException , IOException { Configuration resultConfig = new Configuration ( ) ; if ( ! Utils . localFileExists ( this . getConfigFileName ( ) ) ) { File file = new File ( this . locateConfigFileName ( this . getConfigDir ( ) , this . getConfigFileName ( ) ) ) ; mCo...
Load configuration from ddf . ini or the file name specified by the environment variable DDF_INI .
12,387
private String locateConfigFileName ( String configDir , String configFileName ) throws IOException { String curDir = new File ( "." ) . getCanonicalPath ( ) ; String path = null ; for ( int i = 0 ; i < 10 ; i ++ ) { path = String . format ( "%s/%s" , curDir , configFileName ) ; if ( Utils . localFileExists ( path ) ) ...
Search in current dir and working up looking for the config file
12,388
public Set < Class < ? > > findAllExtendedGroups ( final Collection < Class < ? > > baseGroups ) throws IllegalArgumentException { final Set < Class < ? > > found = new HashSet < > ( ) ; final Stack < Class < ? > > remaining = new Stack < > ( ) ; baseGroups . forEach ( group -> { if ( ! inheritanceMapping . containsKey...
Finds all of the validation groups extended by an intial set of groups .
12,389
private void updateServiceLocalCache ( ) { try { LOG . info ( "Update local cache now..." ) ; zkClient . getChildren ( NaviCommonConstant . ZOOKEEPER_BASE_PATH ) ; LOG . info ( "Zookeeper global root path is " + NaviCommonConstant . ZOOKEEPER_BASE_PATH ) ; ServiceLocalCache . prepare ( ) ; if ( ArrayUtil . isEmpty ( Rp...
Refresh all service info in local cache
12,390
private void doConnect ( ) { try { LOG . info ( "Connecting to zookeeper server - " + RpcClientConf . ZK_SERVER_LIST ) ; zkClient = new SimpleZooKeeperClient ( RpcClientConf . ZK_SERVER_LIST , RpcClientConf . ZK_DIGEST_AUTH , new ServiceWatcher ( ) ) ; updateServiceLocalCache ( ) ; } catch ( Exception e ) { LOG . error...
Connect to zookeeper server
12,391
private boolean isInZkWathcedNamespacePaths ( String path ) { if ( StringUtil . isEmpty ( path ) ) { return false ; } for ( String watchNamespacePath : RpcClientConf . ZK_WATCH_NAMESPACE_PATHS ) { if ( StringUtil . isEmpty ( watchNamespacePath ) ) { continue ; } if ( path . contains ( watchNamespacePath ) ) { return tr...
Check if the changed path is in the watched paths that the client should care
12,392
private boolean checkDeTaxNumber ( final String ptaxNumber ) { final int fa = Integer . parseInt ( StringUtils . substring ( ptaxNumber , 2 , 4 ) ) ; final int sb = Integer . parseInt ( StringUtils . substring ( ptaxNumber , 5 , 8 ) ) ; final int checkSum = ptaxNumber . charAt ( 12 ) - '0' ; if ( StringUtils . startsWi...
check the Tax Identification Number number country version for Germany .
12,393
public static Map < String , Object > parse ( String fileContent ) { MapFormatter f = new MapFormatter ( ) ; Parser p = new Parser ( f ) ; p . parse ( fileContent , "feature" , 0 ) ; return f . getFeature ( ) ; }
Parse the content of a feature file .
12,394
public static Map < String , String > readPhoneCountryNames ( final Locale plocale ) { final PhoneCountryNameConstants phoneCountryNames = GWT . create ( PhoneCountryNameConstants . class ) ; return phoneCountryNames . phoneCountryNames ( ) ; }
read phone country names .
12,395
public static Map < String , String > readPhoneCountryCodes ( final Locale plocale ) { final PhoneCountryCodeConstants phoneCountryCodes = GWT . create ( PhoneCountryCodeConstants . class ) ; return phoneCountryCodes . phoneCountryCodes ( ) ; }
read phone country codes and country iso codes .
12,396
public static Map < String , String > readPhoneTrunkAndExitCodes ( final Locale plocale ) { final PhoneCountryTrunkAndExitCodesConstants phoneTrunkAndExitCodes = GWT . create ( PhoneCountryTrunkAndExitCodesConstants . class ) ; return phoneTrunkAndExitCodes . phoneTrunkAndExitCodes ( ) ; }
read phone trunk an exit code map from property file .
12,397
public static NodeImpl createContainerElementNode ( final String name , final NodeImpl parent ) { return new NodeImpl ( name , parent , false , null , null , ElementKind . CONTAINER_ELEMENT , EMPTY_CLASS_ARRAY , null , null , null , null ) ; }
create container element node .
12,398
public static NodeImpl createParameterNode ( final String name , final NodeImpl parent , final int parameterIndex ) { return new NodeImpl ( name , parent , false , null , null , ElementKind . PARAMETER , EMPTY_CLASS_ARRAY , parameterIndex , null , null , null ) ; }
create parameter node .
12,399
public static NodeImpl createCrossParameterNode ( final NodeImpl parent ) { return new NodeImpl ( CROSS_PARAMETER_NODE_NAME , parent , false , null , null , ElementKind . CROSS_PARAMETER , EMPTY_CLASS_ARRAY , null , null , null , null ) ; }
create cross parameter node node .