idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
143,100
public void remove ( Widget w ) { int index = indexOf ( w ) ; if ( index == - 1 ) { throw new NoSuchElementException ( ) ; } remove ( index ) ; }
Removes the specified widget .
143,101
Class < ? > getSetterPropertyType ( Clazz < ? > clazz , String name ) { ClassInfoCache cache = retrieveCache ( clazz ) ; Class < ? > res = cache . getSetterType ( name ) ; if ( res != null ) return res ; String setterName = "set" + capitalizeFirstLetter ( name ) ; Method setter = clazz . getMethod ( setterName ) ; if (...
Returns the class of the setter property . It can be this of the setter or of the field
143,102
boolean hasObjectDynamicProperty ( Object object , String propertyName ) { DynamicPropertyBag bag = propertyBagAccess . getObjectDynamicPropertyBag ( object ) ; return bag != null && bag . contains ( propertyName ) ; }
Whether a dynamic property value has already been set on this object
143,103
public void register ( Object source , String path ) { unregister ( ) ; dataBinding = Binder . bind ( source , path ) . mode ( Mode . OneWay ) . to ( adapter ) . activate ( ) ; }
Registers the databinding source . If any previous source was binded its bindings are freed .
143,104
public static BindingCreation bind ( Object source , String propertyPath ) { return createBinder ( new CompositePropertyAdapter ( source , propertyPath ) ) ; }
First step accepts a data binding source definition and creates a binder
143,105
public static DataBinding map ( Object source , Object destination ) { return bindObject ( source ) . mapTo ( destination ) ; }
Maps two objects together . All matching fields will then be two - way data - bound .
143,106
public HttpResponse postTopicMessage ( String topicName , String jsonPayload , Map < String , String > headers ) throws RestClientException { return postMessage ( Type . TOPIC , topicName , jsonPayload , headers ) ; }
Sends a message to the REST endpoint in order to put a message on the given topic .
143,107
public HttpResponse postQueueMessage ( String queueName , String jsonPayload , Map < String , String > headers ) throws RestClientException { return postMessage ( Type . QUEUE , queueName , jsonPayload , headers ) ; }
Sends a message to the REST endpoint in order to put a message on the given queue .
143,108
public void run ( AcceptsOneWidget container ) { container . setWidget ( UiBuilder . addIn ( new VerticalPanel ( ) , personListWidget , personneForm , categoryForm , nextButton ) ) ; Bind ( personListWidget , "selectedPersonne" ) . Mode ( Mode . OneWay ) . Log ( "PERSONNEFORM" ) . To ( personneForm , "personne" ) ; Bin...
Runs the demo
143,109
private void _RemoveValidator ( Row item , int column ) { if ( m_currentEditedItem == null && m_currentEditedColumn < 0 ) return ; if ( m_callback != null ) m_callback . onTouchCellContent ( item , column ) ; if ( m_currentEditor != null ) m_currentEditor . removeFromParent ( ) ; m_currentEditor = null ; m_currentEdite...
just replace the validator widget by a text in the table
143,110
public static void processFile ( String input , String mappingPath , String outputFile , boolean doPrune , Log log ) throws IOException { Set < String > usedClassNames = new HashSet < > ( ) ; input = replaceClassNames ( input , mappingPath , usedClassNames , log ) ; log . debug ( usedClassNames . size ( ) + " used css ...
Process an input file
143,111
public void updateGroup ( long groupId , String name , boolean isPrivate ) { LinkedMultiValueMap < String , String > params = new LinkedMultiValueMap < String , String > ( ) ; params . set ( "name" , name ) ; params . set ( "private" , String . valueOf ( isPrivate ) ) ; restTemplate . put ( buildUri ( "groups/" + group...
Method returns 401 from Yammer so it isn t visible in GroupOperations yet
143,112
static Map < String , String > getVersionAttributes ( URL url ) throws IOException { Map < String , String > ret = new LinkedHashMap < > ( ) ; try ( InputStream inputStream = url . openStream ( ) ) { Manifest manifest = new Manifest ( inputStream ) ; Attributes attributes = manifest . getMainAttributes ( ) ; for ( Stri...
For the sake of unit testing
143,113
protected View createOverlayView ( ) { LinearLayout ll = new LinearLayout ( getContext ( ) ) ; ll . setLayoutParams ( new FrameLayout . LayoutParams ( FrameLayout . LayoutParams . MATCH_PARENT , FrameLayout . LayoutParams . MATCH_PARENT ) ) ; ll . setGravity ( Gravity . CENTER ) ; View progressBar = createProgressBar (...
create loading mask
143,114
protected String getNestName ( ) { if ( nestName == null || nestName . equals ( NestSubsystemExtension . NEST_NAME_AUTOGENERATE ) ) { return this . envServiceValue . getValue ( ) . getNodeName ( ) ; } else { return nestName ; } }
Do not call this until the nest has been initialized - it needs a dependent service .
143,115
@ RobotKeyword ( "Connect to MQTT Broker" ) @ ArgumentNames ( { "broker" , "clientId" } ) public void connectToMQTTBroker ( String broker , String clientId ) throws MqttException { client = new MqttClient ( broker , clientId ) ; System . out . println ( "*INFO:" + System . currentTimeMillis ( ) + "* connecting to broke...
Connect to an MQTT broker .
143,116
@ ArgumentNames ( { "topic" , "message" } ) public void publishToMQTTSynchronously ( String topic , Object message ) throws MqttException { publishToMQTTSynchronously ( topic , message , 0 , false ) ; }
Publish a message to a topic
143,117
@ RobotKeyword ( "Publish to MQTT Synchronously" ) @ ArgumentNames ( { "topic" , "message" , "qos=0" , "retained=false" } ) public void publishToMQTTSynchronously ( String topic , Object message , int qos , boolean retained ) throws MqttException { MqttMessage msg ; if ( message instanceof String ) { msg = new MqttMess...
Publish a message to a topic with specified qos and retained flag
143,118
@ RobotKeyword ( "Disconnect from MQTT Broker" ) public void disconnectFromMQTTBroker ( ) { if ( client != null ) { try { client . disconnect ( ) ; } catch ( MqttException e ) { throw new RuntimeException ( e . getLocalizedMessage ( ) ) ; } } }
Disconnect from MQTT Broker
143,119
@ RobotKeyword ( "Subscribe to MQTT Broker and validate that it received a specific message" ) @ ArgumentNames ( { "broker" , "clientId" , "topic" , "expectedPayload" , "timeout" } ) public void subscribeToMQTTAndValidate ( String broker , String clientId , String topic , String expectedPayload , long timeout ) { MqttC...
Subscribe to an MQTT broker and validate that a message with specified payload is received
143,120
private String _getUniqueKey ( ) { StringBuilder b = new StringBuilder ( ) ; b . append ( service ) ; b . append ( "#" ) ; b . append ( method ) ; if ( params != null ) { b . append ( "#" ) ; b . append ( params . toString ( ) ) ; } return b . toString ( ) ; }
calculate the unique key of that request
143,121
public void initialize ( @ Initialized ( ApplicationScoped . class ) Object ignore ) { log . debugf ( "Initializing [%s]" , this . getClass ( ) . getName ( ) ) ; try { feedSessionListenerProducer = new BiFunction < String , Session , WsSessionListener > ( ) { public WsSessionListener apply ( String key , Session sessio...
This creates the bi - function listener - producers that will create listeners which will create JMS bus listeners for each websocket session that gets created in the future .
143,122
void modifyData ( final TrieNode < V > node , final V value ) { node . value = value ; ++ modCount ; ++ size ; }
Sets the given value as the new value on the given node increases size and modCount .
143,123
private void addNode ( final TrieNode < V > node , final CharSequence key , final int beginIndex , final TrieNode < V > newNode ) { final int lastKeyIndex = key . length ( ) - 1 ; TrieNode < V > currentNode = node ; int i = beginIndex ; for ( ; i < lastKeyIndex ; i ++ ) { final TrieNode < V > nextNode = new TrieNode < ...
Adds the given new node to the node with the given key beginning at beginIndex .
143,124
V removeMapping ( final Object o ) { if ( ! ( o instanceof Map . Entry ) ) { throw new IllegalArgumentException ( ) ; } @ SuppressWarnings ( "unchecked" ) final Entry < ? extends CharSequence , V > e = ( Map . Entry < ? extends CharSequence , V > ) o ; final CharSequence key = keyCheck ( e . getKey ( ) ) ; final V valu...
Special version of remove for EntrySet .
143,125
private void compact ( final CharSequence key ) { final int keyLength = key . length ( ) ; TrieNode < V > currentNode = getRoot ( ) ; TrieNode < V > lastInUseNode = currentNode ; int lastInUseIndex = 0 ; for ( int i = 0 ; i < keyLength && currentNode != null ; i ++ ) { if ( currentNode . inUse ) { lastInUseNode = curre...
Compact the trie by removing unused nodes on the path that is specified by the given key .
143,126
public static String getTypeQualifiedName ( TypeMirror type ) throws CodeGenerationIncompleteException { if ( type . toString ( ) . equals ( "<any>" ) ) { throw new CodeGenerationIncompleteException ( "Type reported as <any> is likely a not-yet " + "generated parameterized type." ) ; } switch ( type . getKind ( ) ) { c...
Returns the qualified name of a TypeMirror .
143,127
public boolean IsInside ( String pDate ) { if ( periods == null ) { if ( days == null ) return false ; if ( days . getDay ( CalendarFunctions . date_get_day ( pDate ) ) . get ( ) > 0 ) return true ; return false ; } for ( int i = 0 ; i < periods . size ( ) ; i ++ ) { Period period = periods . get ( i ) ; if ( period . ...
false if not
143,128
public boolean IsContained ( String pFrom , String pTo ) { if ( periods == null ) { throw new RuntimeException ( "Error Periods is Null" ) ; } for ( int i = 0 ; i < periods . size ( ) ; i ++ ) { Period period = periods . get ( i ) ; if ( period . getFrom ( ) . compareTo ( pFrom ) > 0 ) return false ; if ( ( pFrom . com...
list of periods false if not
143,129
public void Resolve ( String pFrom , String pTo ) { if ( periods != null ) { throw new RuntimeException ( "Error call on an already resolved CalendarPeriod" ) ; } int nb = 0 ; for ( int i = 0 ; i < 7 ; i ++ ) nb += days . getDay ( i ) . get ( ) ; if ( nb == 7 ) { periods = new ArrayList < Period > ( ) ; periods . add (...
from and to parameters
143,130
private List < Period > _Intersect ( List < Period > periods1 , List < Period > periods2 ) { List < Period > result = new ArrayList < Period > ( ) ; int count1 = periods1 . size ( ) ; int count2 = periods2 . size ( ) ; int i = 0 ; int j = 0 ; while ( i < count1 && j < count2 ) { if ( periods1 . get ( i ) . getFrom ( ) ...
intersect two period arrays
143,131
protected Integer compareNullObjects ( Object object1 , Object object2 ) { if ( ( object1 == null ) && ( object2 == null ) ) { return 0 ; } if ( object1 == null ) { return 1 ; } if ( object2 == null ) { return - 1 ; } return null ; }
Checks for null objects and returns the proper result depedning on which object is null
143,132
public PathBuilder append ( String cmd , double ... coords ) { s . append ( cmd ) . append ( " " ) ; for ( double a : coords ) { s . append ( a ) . append ( " " ) ; } return this ; }
append an SVG Path command to this instance
143,133
public Object handle ( InvocationContext ic ) throws Exception { Method m = ic . getMethod ( ) ; Object targetObject = ic . getTarget ( ) ; Class < ? > targetClass = targetObject == null ? m . getDeclaringClass ( ) : targetObject . getClass ( ) ; CatchHandler exceptionHandlerAnnotation = AnnotationUtils . findAnnotatio...
Handles the exception .
143,134
private boolean invokeCleanups ( Class < ? > clazz , Object target , Class < ? > cleanupClazz , Throwable exception ) throws Exception { boolean invoked = false ; if ( ! cleanupClazz . equals ( Object . class ) ) { List < Method > methods = ReflectionUtils . getMethods ( target . getClass ( ) , Cleanup . class ) ; Meth...
Invokes the cleanup methods of the exception handler or exception handling .
143,135
public ProducerConnectionContext createProducerConnectionContext ( Endpoint endpoint ) throws JMSException { ProducerConnectionContext context = new ProducerConnectionContext ( ) ; createOrReuseConnection ( context , true ) ; createSession ( context ) ; createDestination ( context , endpoint ) ; createProducer ( contex...
Creates a new producer connection context reusing any existing connection that might have already been created . The destination of the connection s session will be that of the given endpoint .
143,136
protected void cacheConnection ( Connection connection , boolean closeExistingConnection ) { if ( this . connection != null && closeExistingConnection ) { try { this . connection . close ( ) ; } catch ( JMSException e ) { msglog . errorCannotCloseConnectionMemoryMightLeak ( e ) ; } } this . connection = connection ; }
To store a connection in this processor object call this setter . If there was already a cached connection it will be closed .
143,137
protected void createConnection ( ConnectionContext context ) throws JMSException { if ( context == null ) { throw new IllegalStateException ( "The context is null" ) ; } ConnectionFactory factory = getConnectionFactory ( ) ; Connection conn = factory . createConnection ( ) ; context . setConnection ( conn ) ; }
Creates a connection using this object s connection factory and stores that connection in the given context object .
143,138
protected void createSession ( ConnectionContext context ) throws JMSException { if ( context == null ) { throw new IllegalStateException ( "The context is null" ) ; } Connection conn = context . getConnection ( ) ; if ( conn == null ) { throw new IllegalStateException ( "The context had a null connection" ) ; } Sessio...
Creates a default session using the context s connection . This implementation creates a non - transacted auto - acknowledged session . Subclasses are free to override this behavior .
143,139
protected void createDestination ( ConnectionContext context , Endpoint endpoint ) throws JMSException { if ( endpoint == null ) { throw new IllegalStateException ( "Endpoint is null" ) ; } if ( context == null ) { throw new IllegalStateException ( "The context is null" ) ; } Session session = context . getSession ( ) ...
Creates a destination using the context s session . The destination correlates to the given named queue or topic .
143,140
protected void createProducer ( ProducerConnectionContext context ) throws JMSException { if ( context == null ) { throw new IllegalStateException ( "The context is null" ) ; } Session session = context . getSession ( ) ; if ( session == null ) { throw new IllegalStateException ( "The context had a null session" ) ; } ...
Creates a message producer using the context s session and destination .
143,141
protected void createConsumer ( ConsumerConnectionContext context , String messageSelector ) throws JMSException { if ( context == null ) { throw new IllegalStateException ( "The context is null" ) ; } Session session = context . getSession ( ) ; if ( session == null ) { throw new IllegalStateException ( "The context h...
Creates a message consumer using the context s session and destination .
143,142
public static Bindings defaultBindings ( ) { return noHashMapBindings ( ) . set ( ClassLoader . class , Thread . currentThread ( ) . getContextClassLoader ( ) ) . set ( ConfigParseOptions . class , ConfigParseOptions . defaults ( ) ) . set ( ConfigResolveOptions . class , ConfigResolveOptions . defaults ( ) ) . set ( C...
Some default bindings that most config factories will need .
143,143
public void Init ( CalendarPeriod period , T value ) { for ( int i = 0 ; i < period . getPeriods ( ) . size ( ) ; i ++ ) { Period p = period . getPeriods ( ) . get ( i ) ; periods . add ( new PeriodAssociative < T > ( p . getFrom ( ) , p . getTo ( ) , value ) ) ; } }
init from a CalendarPeriod with a value
143,144
public Boolean Add ( CalendarPeriodAssociative < T > period , AddFunction < T > addFunction ) { List < PeriodAssociative < T > > combined = _Combine ( periods , period . getPeriods ( ) ) ; List < PeriodAssociative < T > > result = _Merge ( combined , addFunction ) ; if ( result == null ) return null ; periods = result ...
adding two associative periods
143,145
public CalendarPeriod GetCalendarPeriod ( ) { CalendarPeriod res = new CalendarPeriod ( ) ; List < Period > periods = new ArrayList < Period > ( ) ; for ( int i = 0 ; i < this . periods . size ( ) ; i ++ ) { PeriodAssociative < T > p = this . periods . get ( i ) ; periods . add ( new Period ( p . getFrom ( ) , p . getT...
returns the same but with no values and with the periods merged
143,146
private boolean _readDate ( ) { int endIndex = pos + 10 ; if ( endIndex <= len ) { _date = text . substring ( pos , endIndex ) ; pos += 10 ; return true ; } pos = len ; return false ; }
parse a date in the format yyyy - mm - dd
143,147
public void emphasizePoint ( int index ) { if ( dots == null || dots . length < ( index - 1 ) ) return ; if ( emphasizedPoint == index ) return ; if ( emphasizedPoint >= 0 ) { dots [ emphasizedPoint ] . attr ( "r" , dotNormalSize ) ; emphasizedPoint = - 1 ; } if ( index >= 0 ) { dots [ index ] . attr ( "r" , dotBigSize...
index < 0 means that we emphasize no point at all
143,148
public void moveLastChild ( Row newParent ) { if ( this == newParent ) return ; Row parentItem = m_parent ; if ( parentItem == null ) parentItem = this . treeTable . m_rootItem ; parentItem . getChilds ( ) . remove ( this ) ; if ( newParent == null ) newParent = this . treeTable . m_rootItem ; Row lastLeaf = newParent ...
move to be the last item of parent
143,149
public void moveBefore ( Row item ) { if ( this == item ) return ; Element lastTrToMove = getLastLeafTR ( ) ; Element firstChildRow = DOM . getNextSibling ( m_tr ) ; Row parentItem = m_parent ; if ( parentItem == null ) parentItem = this . treeTable . m_rootItem ; parentItem . getChilds ( ) . remove ( this ) ; if ( ite...
move to position just before item
143,150
void removeHandler ( Object handlerRegistration ) { if ( handlerRegistration instanceof DirectHandlerInfo ) { DirectHandlerInfo info = ( DirectHandlerInfo ) handlerRegistration ; info . source . removePropertyChangedHandler ( info . registrationObject ) ; return ; } if ( ! ( handlerRegistration instanceof HandlerInfo )...
Unregisters a handler freeing associated resources
143,151
public static void filterRequest ( ContainerRequestContext requestContext , Predicate < String > predicate ) { String requestOrigin = requestContext . getHeaderString ( Headers . ORIGIN ) ; if ( requestOrigin == null ) { return ; } if ( ! predicate . test ( requestOrigin ) ) { requestContext . abortWith ( Response . st...
Apply CORS filter on request
143,152
public static void filterResponse ( ContainerRequestContext requestContext , ContainerResponseContext responseContext , String extraAccesControlAllowHeaders ) { String requestOrigin = requestContext . getHeaderString ( Headers . ORIGIN ) ; if ( requestOrigin == null ) { return ; } MultivaluedMap < String , Object > res...
Apply CORS headers on response
143,153
public static TableCellElement getCell ( Element root , int column , int row ) { TableSectionElement tbody = getTBodyElement ( root ) ; TableRowElement tr = tbody . getChild ( row ) . cast ( ) ; TableCellElement td = tr . getChild ( column ) . cast ( ) ; return td ; }
Get the TD element
143,154
public static Pair < Integer , Integer > getParentCellForElement ( Element root , Element element ) { Element tbody = getTBodyElement ( root ) ; ArrayList < Element > path = TemplateUtils . isDescendant ( tbody , element ) ; if ( path == null ) return null ; int row = DOM . getChildIndex ( path . get ( 0 ) , path . get...
Returns the coordinate of the cell containing the element given that root is the root of a HtmlTableTemplate
143,155
public static void setDragData ( Object source , Object data ) { DragUtils . source = source ; DragUtils . data = data ; }
Sets the drag and drop data and its source
143,156
public static ConfigFactory webappConfigFactory ( ServletContext servletContext ) { checkNotNull ( servletContext ) ; return webappConfigFactory ( ) . bind ( ServletContextPath . class ) . toInstance ( ServletContextPath . fromServletContext ( servletContext ) ) ; }
A sensible default configuration factory for a web application .
143,157
public void setWidget ( Widget w ) { if ( w == widget ) return ; if ( w != null ) w . removeFromParent ( ) ; if ( widget != null ) remove ( widget ) ; widget = w ; if ( w != null ) { DOM . appendChild ( containerElement , widget . getElement ( ) ) ; adopt ( w ) ; } }
Sets this panel s widget . Any existing child widget will be removed .
143,158
private String getSentenceFromTokens ( final String [ ] tokens ) { final StringBuilder sb = new StringBuilder ( ) ; for ( final String token : tokens ) { sb . append ( token ) . append ( " " ) ; } final String sentence = sb . toString ( ) ; return sentence ; }
It takes an array of tokens and outputs a string with tokens joined by a whitespace .
143,159
private String addHeadWordsToTreebank ( final List < String > inputTrees ) { final StringBuffer parsedDoc = new StringBuffer ( ) ; for ( final String parseSent : inputTrees ) { final Parse parsedSentence = Parse . parseParse ( parseSent ) ; this . headFinder . printHeads ( parsedSentence ) ; parsedSentence . show ( par...
Takes as input a list of parse strings one for line and annotates the headwords
143,160
public void terminate ( ) { log ( "term" ) ; fActivated = false ; converter = null ; source . removePropertyChangedHandler ( sourceHandler ) ; source = null ; sourceHandler = null ; destination . removePropertyChangedHandler ( destinationHandler ) ; destination = null ; destinationHandler = null ; }
Terminates the Data Binding activation and cleans up all related resources . You should call this method when you want to free the binding in order to lower memory usage .
143,161
public static void tryToShowPrompt ( Context context , OnCompleteListener onCompleteListener ) { tryToShowPrompt ( context , null , null , onCompleteListener ) ; }
Show rating dialog . The dialog will be showed if the user hasn t declined to rate or hasn t rated current version .
143,162
public static void resetIfAppVersionChanged ( Context context ) { SharedPreferences prefs = getSharedPreferences ( context ) ; int appVersionCode = Integer . MIN_VALUE ; final int previousAppVersionCode = prefs . getInt ( PREF_KEY_APP_VERSION_CODE , Integer . MIN_VALUE ) ; try { appVersionCode = context . getPackageMan...
Reset saved conditions if app version changed .
143,163
public static Class < ? > getObjectClassOfPrimitve ( Class < ? > primitive ) { Class < ? > objectClass = PRIMITIVE_TO_WRAPPER . get ( primitive ) ; if ( objectClass != null ) { return objectClass ; } return primitive ; }
Returns the wrapper class of the given primitive class or the given class .
143,164
public static int getTypeVariablePosition ( GenericDeclaration genericDeclartion , TypeVariable < ? > typeVariable ) { int position = - 1 ; TypeVariable < ? > [ ] typeVariableDeclarationParameters = genericDeclartion . getTypeParameters ( ) ; for ( int i = 0 ; i < typeVariableDeclarationParameters . length ; i ++ ) { i...
Tries to find the position of the given type variable in the type parameters of the given class . This method iterates through the type parameters of the given class and tries to find the given type variable within the type parameters . When the type variable is found the position is returned otherwise - 1 .
143,165
public static Field [ ] getMatchingFields ( Class < ? > clazz , final int modifiers ) { final Set < Field > fields = new TreeSet < Field > ( FIELD_NAME_AND_DECLARING_CLASS_COMPARATOR ) ; traverseHierarchy ( clazz , new TraverseTask < Field > ( ) { public Field run ( Class < ? > clazz ) { Field [ ] fieldArray = clazz . ...
Returns the field objects that are declared in the given class or any of it s super types that have any of the given modifiers . The type hierarchy is traversed upwards and all declared fields that match the given modifiers are added to the result array . The elements in the array are sorted by their names and declarin...
143,166
public static Field getField ( Class < ? > clazz , String fieldName ) { final String internedName = fieldName . intern ( ) ; return traverseHierarchy ( clazz , new TraverseTask < Field > ( ) { public Field run ( Class < ? > clazz ) { Field [ ] fields = clazz . getDeclaredFields ( ) ; for ( int i = 0 ; i < fields . leng...
Returns the field object found for the given field name in the given class . This method traverses through the super classes of the given class and tries to find the field as declared field within these classes . When the object class is reached the traversing stops . If the field can not be found null is returned .
143,167
public static Method getMethod ( Class < ? > clazz , final String methodName , final Class < ? > ... parameterTypes ) { final String internedName = methodName . intern ( ) ; return traverseHierarchy ( clazz , new TraverseTask < Method > ( ) { public Method run ( Class < ? > clazz ) { Method [ ] methods = clazz . getDec...
Returns the method object found for the given method name in the given class . This method traverses through the super classes of the given class and tries to find the method as declared method within these classes . When the object class is reached the traversing stops . If the method can not be found null is returned...
143,168
public static List < Method > getMethods ( Class < ? > clazz , final Class < ? extends Annotation > annotation ) { final List < Method > methods = new ArrayList < Method > ( ) ; traverseHierarchy ( clazz , new TraverseTask < Method > ( ) { public Method run ( Class < ? > clazz ) { Method [ ] methodArray = clazz . getDe...
Returns the method objects for methods which are annotated with the given annotation of the given class . This method traverses through the super classes of the given class and tries to find methods as declared methods within these classes which are annotated with an annotation of the given annotation type . When the o...
143,169
public static ArrayList < Element > verifyPath ( Element root , ArrayList < Element > path ) { if ( root == path . get ( 0 ) ) return path ; return null ; }
asserts that a path s root is the waited element
143,170
public T getRecordForRow ( Row row ) { Integer recordId = rowToRecordIds . get ( row ) ; if ( recordId == null ) return null ; return getRecordForId ( recordId ) ; }
Gets the record associated with a specific Row
143,171
public static Class < ? > getSetterPropertyType ( Clazz < ? > clazz , String name ) { return propertyValues . getSetterPropertyType ( clazz , name ) ; }
Returns the class of the setter property . It can be the class of the first argument in the setter or the class of the field if no setter is found . If a virtual property is used it returns null or the class of the current property s value
143,172
private Map < String , Object > extractErrorDetailsFromResponse ( ClientHttpResponse response ) throws IOException { ObjectMapper mapper = new ObjectMapper ( new JsonFactory ( ) ) ; try { return mapper . < Map < String , Object > > readValue ( response . getBody ( ) , new TypeReference < Map < String , Object > > ( ) {...
Error details are returned in the message body as JSON . Extract these in a map
143,173
private void key ( final byte key [ ] ) { int i ; final int koffp [ ] = { 0 } ; final int lr [ ] = { 0 , 0 } ; final int plen = P . length , slen = S . length ; for ( i = 0 ; i < plen ; i ++ ) { P [ i ] = P [ i ] ^ streamtoword ( key , koffp ) ; } for ( i = 0 ; i < plen ; i += 2 ) { encipher ( lr , 0 ) ; P [ i ] = lr [...
Key the Blowfish cipher
143,174
public final static int createLocalId ( ) { Storage storage = Storage . getLocalStorageIfSupported ( ) ; if ( storage == null ) return 0 ; int increment = 0 ; String incrementString = storage . getItem ( LOCAL_CURRENT_ID_INCREMENT ) ; try { increment = Integer . parseInt ( incrementString ) ; } catch ( Exception e ) { ...
Create a negative ID .
143,175
public < T > void RegisterClazz ( Clazz < T > clazz ) { _ensureMap ( ) ; if ( clazzz . containsKey ( clazz . getReflectedClass ( ) ) ) return ; clazzz . put ( clazz . getReflectedClass ( ) , clazz ) ; }
Register a runtime type information provider
143,176
public void init ( String baseUrl , XRPCBatchRequestSender callback ) { this . url = baseUrl + "&locale=" + LocaleInfo . getCurrentLocale ( ) . getLocaleName ( ) ; this . callback = callback ; }
initialize with url and other needed information
143,177
private void checkCallService ( RequestCallInfo info ) { String service = info . request . service ; String interfaceChecksum = info . request . interfaceChecksum ; String key = getServiceKey ( info ) ; if ( usedServices . containsKey ( key ) ) return ; ServiceInfo serviceInfo = new ServiceInfo ( service , interfaceChe...
necessary to be sure that call s service is referenced
143,178
public boolean send ( ) { assert sentRequests == null ; sentRequests = new ArrayList < RequestCallInfo > ( ) ; addPrependedRequests ( sentRequests ) ; while ( ! requestsToSend . isEmpty ( ) ) sentRequests . add ( requestsToSend . remove ( 0 ) ) ; addAppendedRequests ( sentRequests ) ; JSONArray payload = createPayload ...
when response arrives it will be given back to each request callback
143,179
private RequestBuilder buildMultipart ( String name , String value ) { String boundary = "AJAX------" + Math . random ( ) + "" + new Date ( ) . getTime ( ) ; RequestBuilder builderPost = new RequestBuilder ( RequestBuilder . POST , url ) ; builderPost . setHeader ( "Content-Type" , "multipart/form-data; charset=utf-8; ...
prepare a multipart form http request
143,180
public FormCreator field ( Widget widget ) { return field ( widget , totalWidth - currentlyUsedWidth - ( fFirstItem ? 0 : spacing ) ) ; }
automatically fills the line to the end
143,181
public void copy ( ConnectionContext source ) { this . connection = source . connection ; this . session = source . session ; this . destination = source . destination ; }
Sets this context object with the same data found in the source context .
143,182
public static Set < Annotation > getAllAnnotations ( Method m ) { Set < Annotation > annotationSet = new LinkedHashSet < Annotation > ( ) ; Annotation [ ] annotations = m . getAnnotations ( ) ; List < Class < ? > > annotationTypes = new ArrayList < Class < ? > > ( ) ; for ( Annotation a : annotations ) { annotationSet ...
Returns all annotations of a class also the annotations of the super classes implemented interfaces and the annotations that are present in stereotype annotations . The stereotype annotation will not be included in the annotation set .
143,183
public static < T extends Annotation > T findAnnotation ( Method m , Class < T > annotationClazz ) { T annotation = m . getAnnotation ( annotationClazz ) ; if ( annotation != null ) { return annotation ; } if ( stereotypeAnnotationClass != null ) { List < Class < ? > > annotations = new ArrayList < > ( ) ; for ( Annota...
Returns the annotation object for the specified annotation class of the method if it can be found otherwise null . The annotation is searched in the method which and if a stereotype annotation is found the annotations present on an annotation are also examined . If the annotation can not be found null is returned .
143,184
public static < T extends Annotation > T findAnnotation ( Class < ? > clazz , Class < T > annotationClazz ) { T annotation = clazz . getAnnotation ( annotationClazz ) ; if ( annotation != null ) { return annotation ; } Set < Class < ? > > superTypes = ReflectionUtils . getSuperTypes ( clazz ) ; for ( Class < ? > type :...
Returns the annotation object for the specified annotation class of the given class object . All super types of the given class are examined to find the annotation . If a stereotype annotation is found the annotations present on an annotation are also examined .
143,185
public < T extends BasicMessage > void listen ( ConsumerConnectionContext context , AbstractBasicMessageListener < T > listener ) throws JMSException { if ( context == null ) { throw new NullPointerException ( "context must not be null" ) ; } if ( listener == null ) { throw new NullPointerException ( "listener must not...
Listens for messages .
143,186
public MessageId send ( ProducerConnectionContext context , BasicMessage basicMessage , Map < String , String > headers ) throws JMSException { if ( context == null ) { throw new IllegalArgumentException ( "context must not be null" ) ; } if ( basicMessage == null ) { throw new IllegalArgumentException ( "message must ...
Send the given message to its destinations across the message bus . Once sent the message will get assigned a generated message ID . That message ID will also be returned by this method .
143,187
public < T extends BasicMessage > RPCConnectionContext sendAndListen ( ProducerConnectionContext context , BasicMessage basicMessage , BasicMessageListener < T > responseListener , Map < String , String > headers ) throws JMSException { if ( context == null ) { throw new IllegalArgumentException ( "context must not be ...
Send the given message to its destinations across the message bus and any response sent back will be passed to the given listener . Use this for request - response messages where you expect to get a non - void response back .
143,188
public void sendBasicMessageAsync ( Session session , BasicMessage msg ) { String text = ApiDeserializer . toHawkularFormat ( msg ) ; sendTextAsync ( session , text ) ; }
Converts the given message to JSON and sends that JSON text to clients asynchronously .
143,189
public void sendBinaryAsync ( Session session , InputStream inputStream , ExecutorService threadPool ) { if ( session == null ) { return ; } if ( inputStream == null ) { throw new IllegalArgumentException ( "inputStream must not be null" ) ; } log . debugf ( "Attempting to send async binary data to client [%s]" , sessi...
Sends binary data to a client asynchronously .
143,190
public void sendBinarySync ( Session session , InputStream inputStream ) throws IOException { if ( session == null ) { return ; } if ( inputStream == null ) { throw new IllegalArgumentException ( "inputStream must not be null" ) ; } log . debugf ( "Attempting to send binary data to client [%s]" , session . getId ( ) ) ...
Sends binary data to a client synchronously .
143,191
public void uiClientSessionOpen ( Session session ) { log . infoWsSessionOpened ( session . getId ( ) , endpoint ) ; wsEndpoints . getUiClientSessions ( ) . addSession ( session . getId ( ) , session ) ; WelcomeResponse welcomeResponse = new WelcomeResponse ( ) ; welcomeResponse . setSessionId ( session . getId ( ) ) ;...
When a UI client connects this method is called . This will immediately send a welcome message to the UI client .
143,192
private void doStart ( ) throws LifecycleException { tomcat . getServer ( ) . addLifecycleListener ( new TomcatLifecycleListener ( ) ) ; logger . info ( "Deploying application to [" + getConfig ( ) . getDeployUrl ( ) + "]" ) ; tomcat . start ( ) ; if ( getConfig ( ) . getPort ( ) == EmbedVaadinConfig . DEFAULT_PORT ) {...
Fires the embedded tomcat that is assumed to be fully configured .
143,193
private void doStop ( ) throws LifecycleException { logger . info ( "Stopping tomcat." ) ; long startTime = System . currentTimeMillis ( ) ; tomcat . stop ( ) ; long duration = System . currentTimeMillis ( ) - startTime ; logger . info ( "Tomcat shutdown finished in " + duration + " ms." ) ; }
Stops the embedded tomcat .
143,194
public LogTarget addDelegate ( Log log ) { LogProxyTarget logProxyTarget = new LogProxyTarget ( log ) ; this . addTarget ( logProxyTarget ) ; return logProxyTarget ; }
Adds a ProxyTarget for an other Logger
143,195
public Object addingService ( ServiceReference reference ) { HttpService httpService = ( HttpService ) context . getService ( reference ) ; String alias = this . getAlias ( ) ; String name = this . getProperty ( RESOURCE_NAME ) ; if ( name == null ) name = alias ; try { httpService . registerResources ( alias , name , ...
Http Service is up add my resource .
143,196
public final void setTypeName ( final String typeName ) { if ( typeName == null ) { type = LOOKING_AT ; } else if ( typeName . equalsIgnoreCase ( TYPES [ 0 ] ) ) { type = MATCHES ; } else if ( typeName . equalsIgnoreCase ( TYPES [ 1 ] ) ) { type = LOOKING_AT ; } else if ( typeName . equalsIgnoreCase ( TYPES [ 2 ] ) ) {...
Sets the type name of the matching .
143,197
public static Reflect onObject ( Object object ) { if ( object == null ) { return new Reflect ( null , null ) ; } return new Reflect ( object , object . getClass ( ) ) ; }
Creates an instance of Reflect associated with an object
143,198
public static Reflect onClass ( String clazz ) throws Exception { return new Reflect ( null , ReflectionUtils . getClassForName ( clazz ) ) ; }
Creates an instance of Reflect associated with a class
143,199
public boolean containsField ( String name ) { if ( StringUtils . isNullOrBlank ( name ) ) { return false ; } return ClassDescriptorCache . getInstance ( ) . getClassDescriptor ( clazz ) . getFields ( accessAll ) . stream ( ) . anyMatch ( f -> f . getName ( ) . equals ( name ) ) ; }
Determines if a field with the given name is associated with the class