idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
9,300
public String getRewrittenActionURI ( String actionName , Map parameters , boolean asValidXml ) throws URISyntaxException { if ( _perRequestState == null ) { throw new IllegalStateException ( "getRewrittenActionURI was called outside of a valid context." ) ; } ServletContext servletContext = getServletContext ( ) ; Htt...
Create a fully - rewritten URI given an action and parameters .
9,301
public Class getRoot ( Class clazz , HashMap derivesFrom ) { while ( derivesFrom . containsKey ( clazz ) ) clazz = ( Class ) derivesFrom . get ( clazz ) ; return clazz ; }
Unwinds the results of reflecting through the interface inheritance hierachy to find the original root class from a derived class
9,302
public InitialContext getInitialContext ( ) throws ControlException { if ( _initialContext != null ) { return _initialContext ; } Properties props = ( Properties ) _context . getControlPropertySet ( Properties . class ) ; String url = nullIfEmpty ( props . url ( ) ) ; String factory = nullIfEmpty ( props . factory ( ) ...
Get the initial context .
9,303
protected String nullIfEmpty ( String str ) { return ( str == null || str . trim ( ) . length ( ) == 0 ) ? null : str ; }
Return null if the given string is null or an empty string .
9,304
public void register ( XAttribute attribute ) { if ( keyMap . containsKey ( attribute . getKey ( ) ) == false ) { XAttribute prototype = XAttributeUtils . derivePrototype ( attribute ) ; keyMap . put ( attribute . getKey ( ) , prototype ) ; frequencies . put ( attribute . getKey ( ) , 1 ) ; Set < XAttribute > typeSet =...
Registers a concrete attribute with this registry .
9,305
public void addTemplate ( String templateName , URLTemplate template ) { if ( templateName == null || templateName . length ( ) == 0 ) { throw new IllegalArgumentException ( "Template name cannot be null or empty." ) ; } if ( template == null ) { throw new IllegalArgumentException ( "URLTemplate cannot be null." ) ; } ...
Add a template from url - template - config by name .
9,306
public URLTemplate [ ] getTemplates ( ) { URLTemplate [ ] templates = new URLTemplate [ _templates . size ( ) ] ; int index = 0 ; for ( Iterator i = _templates . keySet ( ) . iterator ( ) ; i . hasNext ( ) ; ) { String name = ( String ) i . next ( ) ; templates [ index ++ ] = getTemplate ( name ) ; } return templates ;...
Returns the URL templates from url - template - config by name . Always returns a copy of the URLTemplates with the same parsed template data but with cleared set of token values . This allows multiple client requests access to the same parsed template structure without requiring it to be parsed for each request .
9,307
public void addTemplateRefGroup ( String refGroupName , Map templateRefGroup ) { if ( refGroupName == null || refGroupName . length ( ) == 0 ) { throw new IllegalArgumentException ( "Template Reference Group name cannot be null or empty." ) ; } if ( templateRefGroup == null || templateRefGroup . size ( ) == 0 ) { throw...
Add a template reference group from url - template - config by name .
9,308
public String getTemplateNameByRef ( String refGroupName , String key ) { String templateName = null ; Map templateRefGroup = ( Map ) _templateRefGroups . get ( refGroupName ) ; if ( templateRefGroup != null ) { templateName = ( String ) templateRefGroup . get ( key ) ; } return templateName ; }
Retrieve a template name from a reference group in url - template - config .
9,309
public void setOnMouseDown ( String onMouseDown ) { _imageState . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , HtmlConstants . ONMOUSEDOWN , onMouseDown ) ; }
Sets the onMouseDown JavaScript event on the image tag .
9,310
public void addRoutingConstraint ( String activity , AbstractConstraint < ? > constraint ) throws PropertyException { Validate . notNull ( activity ) ; Validate . notEmpty ( activity ) ; Validate . notNull ( constraint ) ; String propertyNameForNewConstraint = addConstraint ( constraint ) ; Set < String > currentConstr...
Adds a routing constraint for an activity .
9,311
private void addActivityWithConstraints ( String activity ) { Validate . notNull ( activity ) ; Validate . notEmpty ( activity ) ; Set < String > currentActivities = getActivitiesWithRoutingConstraints ( ) ; currentActivities . add ( activity ) ; setProperty ( ConstraintContextProperty . ACTIVITIES_WITH_CONSTRAINTS , A...
Adds an activity to the list of activities with routing constraints .
9,312
private void removeActivityWithConstraints ( String activity ) { Validate . notNull ( activity ) ; Validate . notEmpty ( activity ) ; Set < String > currentActivities = getActivitiesWithRoutingConstraints ( ) ; currentActivities . remove ( activity ) ; setProperty ( ConstraintContextProperty . ACTIVITIES_WITH_CONSTRAIN...
Removes an activity from the list of activities with routing constraints .
9,313
public Set < String > getActivitiesWithRoutingConstraints ( ) { Set < String > result = new HashSet < > ( ) ; String propertyValue = getProperty ( ConstraintContextProperty . ACTIVITIES_WITH_CONSTRAINTS ) ; if ( propertyValue == null ) return result ; StringTokenizer activityTokens = StringUtils . splitArrayString ( pr...
Returns the names of all activities with routing constraints .
9,314
public Set < AbstractConstraint < ? > > getRoutingConstraints ( String activity ) throws PropertyException { Set < String > constraintNames = getConstraintNames ( activity ) ; Set < AbstractConstraint < ? > > result = new HashSet < > ( ) ; for ( String constraintName : constraintNames ) { result . add ( getConstraint (...
Returns all routing constraints of the given activity in form of constraint - objects .
9,315
public int doStartTag ( ) throws JspException { ServletRequest request = pageContext . getRequest ( ) ; _tableRenderer = TagRenderingBase . Factory . getRendering ( TagRenderingBase . TABLE_TAG , request ) ; _trRenderer = TagRenderingBase . Factory . getRendering ( TagRenderingBase . TR_TAG , request ) ; _tdRenderer = ...
Prepare to render the dataset that was specified in the dataSource attribute . The dataSource expression is evaluated and the table s dimensions are computed . If there is no data in the dataset but the rows and columns attributes were specified an empty table of the given dimensions is rendered .
9,316
public int doEndTag ( ) throws JspException { if ( hasErrors ( ) ) reportErrors ( ) ; else if ( _valid ) { closeTableTag ( _appender ) ; write ( _sb . toString ( ) ) ; } return EVAL_PAGE ; }
Complete rendering the tag . If no errors have occurred the content that the tag buffered is rendered .
9,317
public Object getCurrentMetadata ( ) { LocalizedUnsupportedOperationException uoe = new LocalizedUnsupportedOperationException ( "The " + getTagName ( ) + "does not export metadata for its iterated items." ) ; uoe . setLocalizedMessage ( Bundle . getErrorString ( "Tags_DataAccessProvider_metadataUnsupported" , new Obje...
Get the metadata for the current item . This method is not supported by this tag .
9,318
public boolean removeAttribute ( String attribute , boolean removeFromACModel , boolean notifyListeners ) { if ( ! super . removeObject ( attribute , false ) ) { return false ; } if ( acModel != null && removeFromACModel && acModel . getContext ( ) != this ) { acModel . getContext ( ) . removeObject ( attribute ) ; } f...
Removes the given attribute from the context .
9,319
public void validateAttribute ( String attribute ) throws CompatibilityException { try { super . validateObject ( attribute ) ; } catch ( CompatibilityException e ) { throw new CompatibilityException ( "Unknown attribute: " + attribute , e ) ; } }
Checks if the given attribute is known i . e . is contained in the attribute list .
9,320
public void validateAttributes ( Collection < String > attributes ) throws CompatibilityException { Validate . notNull ( attributes ) ; for ( String attribute : attributes ) { validateAttribute ( attribute ) ; } }
Checks if the given attributes are known i . e . they are all contained in the attribute list .
9,321
public static List < String > createSubjectList ( int number , String stringFormat ) { Validate . notNegative ( number ) ; Validate . notNull ( stringFormat ) ; List < String > result = new ArrayList < > ( number ) ; for ( int i = 1 ; i <= number ; i ++ ) { result . add ( String . format ( stringFormat , i ) ) ; } retu...
Creates a list of subject names in the given format with the given size .
9,322
public void setOnBlur ( String onblur ) { AbstractHtmlState tsh = getState ( ) ; tsh . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , ONBLUR , onblur ) ; }
Sets the onBlur javascript event .
9,323
public void setOnFocus ( String onfocus ) { AbstractHtmlState tsh = getState ( ) ; tsh . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , ONFOCUS , onfocus ) ; }
Sets the onFocus javascript event .
9,324
public void setOnChange ( String onchange ) { AbstractHtmlState tsh = getState ( ) ; tsh . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , ONCHANGE , onchange ) ; }
Sets the onChange javascript event .
9,325
public void setOnSelect ( String onselect ) { AbstractHtmlState tsh = getState ( ) ; tsh . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , ONSELECT , onselect ) ; }
Sets the onSelect javascript event .
9,326
public void load ( ServletContext servletContext ) { _urlTemplates = new URLTemplates ( ) ; InputStream xmlInputStream = null ; InputStream xsdInputStream = null ; try { xmlInputStream = servletContext . getResourceAsStream ( _configFilePath ) ; if ( xmlInputStream != null ) { xsdInputStream = SCHEMA_RESOLVER . getInpu...
Initialization method that parses the URL template config file to get the URL templates and template reference groups .
9,327
private void loadTemplates ( Element parent ) { List templates = DomUtils . getChildElementsByName ( parent , URL_TEMPLATE ) ; for ( int i = 0 ; i < templates . size ( ) ; i ++ ) { Element template = ( Element ) templates . get ( i ) ; String name = getElementText ( template , NAME ) ; if ( name == null ) { _log . erro...
Loads the templates from a URL template config document .
9,328
private void loadTemplateRefGroups ( Element parent ) { List templateRefGroups = DomUtils . getChildElementsByName ( parent , URL_TEMPLATE_REF_GROUP ) ; ; for ( int i = 0 ; i < templateRefGroups . size ( ) ; i ++ ) { Element refGroupElement = ( Element ) templateRefGroups . get ( i ) ; String refGroupName = getElementT...
Loads the template reference groups from a URL template config document .
9,329
@ SuppressWarnings ( "serial" ) public Client loginAsOwner ( ) throws APIError { requestToken = service . getRequestToken ( ) ; JSONObject token = post ( "/api/v1/users/login_as_owner" , new HashMap < String , Object > ( ) { { put ( "request_token" , requestToken . getToken ( ) ) ; } } ) ; if ( token != null && ! token...
Logins as the first UserVoice account owner of the subdomain .
9,330
public Client loginWithVerifier ( String verifier ) { Token token = service . getAccessToken ( requestToken , new Verifier ( verifier ) ) ; return loginWithAccessToken ( token . getToken ( ) , token . getSecret ( ) ) ; }
Retrieve a client instance for making calls as the user who gave permission in UserVoice site .
9,331
public JSONObject get ( String path ) throws APIError { return request ( Verb . GET , path , null ) ; }
Make a GET API call .
9,332
public JSONObject delete ( String path ) throws APIError { return request ( Verb . DELETE , path , null ) ; }
Make a DELETE API call .
9,333
public JSONObject post ( String path , Map < String , Object > params ) throws APIError { return request ( Verb . POST , path , params ) ; }
Make a GET POST call .
9,334
public JSONObject put ( String path , Map < String , Object > params ) throws APIError { return request ( Verb . PUT , path , params ) ; }
Make a PUT API call .
9,335
static public boolean needsReflection ( AptField genField ) { String accessModifier = genField . getAccessModifier ( ) ; if ( accessModifier . equals ( "private" ) ) return true ; return false ; }
Returns true if the initializer will use Reflection to initialize the field false otherwise .
9,336
private String initClassName ( ) { StringBuffer sb = new StringBuffer ( ) ; String fieldName = _eventField . getName ( ) ; String setName = _eventSet . getClassName ( ) ; sb . append ( Character . toUpperCase ( fieldName . charAt ( 0 ) ) ) ; if ( fieldName . length ( ) > 1 ) sb . append ( fieldName . substring ( 1 ) ) ...
Computes a unique adaptor class name
9,337
public String getFormalClassName ( ) { StringBuffer sb = new StringBuffer ( _className ) ; sb . append ( _eventSet . getFormalTypeParameters ( ) ) ; return sb . toString ( ) ; }
Returns the name of the generated class for this adaptor including any formal type declarations from the associate event set .
9,338
public void addHandler ( AptEvent event , AptMethod eventHandler ) { assert event . getEventSet ( ) == _eventSet ; _handlerMap . put ( event , eventHandler ) ; }
Adds a new EventHandler for a Event to the EventAdaptor
9,339
public String getEventSetBinding ( ) { HashMap < String , TypeMirror > typeBinding = _eventField . getTypeBindingMap ( ) ; StringBuffer sb = new StringBuffer ( ) ; boolean isFirst = true ; for ( TypeParameterDeclaration tpd : _eventSet . getDeclaration ( ) . getFormalTypeParameters ( ) ) { if ( isFirst ) { sb . append ...
Returns any formal type parameter declaration for EventSet interface associated with the adaptor class . This will bind the formal types of the interface based on any type binding from the event field declaration
9,340
public void doTag ( ) throws JspException { Object o = getParent ( ) ; assert ( o != null ) ; if ( ! ( o instanceof TreeItem ) ) { logger . error ( "Invalid Parent (expected a TreeItem):" + o . getClass ( ) . getName ( ) ) ; return ; } TreeItem ti = ( TreeItem ) o ; ti . setItemInheritableState ( _iState ) ; }
Render this Tree control .
9,341
public String getModuleConfPath ( String modulePath ) { if ( _moduleConfigLocators != null ) { for ( int i = 0 ; i < _moduleConfigLocators . length ; ++ i ) { ModuleConfigLocator locator = _moduleConfigLocators [ i ] ; String moduleConfigPath = locator . getModuleConfigPath ( modulePath ) ; try { if ( getConfigResource...
Get the webapp - relative path to the Struts module configration file for a given module path based on registered ModuleConfigLocators .
9,342
private void readObject ( ObjectInputStream stream ) throws IOException , ClassNotFoundException { if ( _log . isInfoEnabled ( ) ) _log . info ( "deserializing ActionServlet " + this ) ; _configParams = ( Map ) stream . readObject ( ) ; }
See comments on writeObject .
9,343
protected URL getConfigResource ( String path ) throws MalformedURLException { URL resource = getServletContext ( ) . getResource ( path ) ; if ( resource != null ) return resource ; if ( path . startsWith ( "/" ) ) path = path . substring ( 1 ) ; return _rch . getResource ( path ) ; }
Get a resource URL for a module configuration file . By default this looks in the ServletContext and in the context classloader .
9,344
protected InputStream getConfigResourceAsStream ( String path ) { InputStream stream = getServletContext ( ) . getResourceAsStream ( path ) ; if ( stream != null ) return stream ; if ( path . startsWith ( "/" ) ) path = path . substring ( 1 ) ; return _rch . getResourceAsStream ( path ) ; }
Get a resource stream for a module configuration file . By default this looks in the ServletContext and in the context classloader .
9,345
protected synchronized ModuleConfig registerModule ( String modulePath , String configFilePath ) throws ServletException { if ( _log . isInfoEnabled ( ) ) { _log . info ( "Dynamically registering module " + modulePath + ", config XML " + configFilePath ) ; } if ( _log . isInfoEnabled ( ) ) { InternalStringBuilder msg =...
Register a Struts module initialized by the given configuration file .
9,346
public void clearRegisteredModules ( ) { ServletContext servletContext = getServletContext ( ) ; for ( Iterator ii = _registeredModules . keySet ( ) . iterator ( ) ; ii . hasNext ( ) ; ) { String modulePrefix = ( String ) ii . next ( ) ; servletContext . removeAttribute ( Globals . MODULE_KEY + modulePrefix ) ; servlet...
Clear the internal map of registered modules .
9,347
public ActionForward doReturnToPage ( FlowControllerHandlerContext context , PreviousPageInfo prevPageInfo , PageFlowController currentPageFlow , ActionForm currentForm , String actionName , Forward pageFlowFwd ) { assert context . getRequest ( ) instanceof HttpServletRequest : "don't support ServletRequest currently."...
Get an ActionForward to the original page that was visible before the previous action .
9,348
public Cookie getCookie ( String cookieName ) { List cookies = getHeaders ( SET_COOKIE ) ; if ( cookies != null ) { for ( int i = cookies . size ( ) ; -- i > - 1 ; ) { Cookie cookie = ( Cookie ) cookies . get ( i ) ; if ( cookie . getName ( ) . equals ( cookieName ) ) { return cookie ; } } } return null ; }
Gets a cookie that was added to the response .
9,349
public Cookie [ ] getCookies ( ) { List cookies = ( List ) _headers . get ( SET_COOKIE ) ; return cookies != null ? ( Cookie [ ] ) cookies . toArray ( new Cookie [ cookies . size ( ) ] ) : NO_COOKIES ; }
Gets all Cookies that were added to the response .
9,350
public Object getFirstHeader ( String name ) { List foundHeaders = ( List ) _headers . get ( name ) ; return ! foundHeaders . isEmpty ( ) ? foundHeaders . get ( 0 ) : null ; }
Gets the first header with the given name .
9,351
public static void parseQueryString ( String str , Map res , String encoding ) { int i = str . indexOf ( '#' ) ; if ( i > 0 ) { str = str . substring ( 0 , i ) ; } StringTokenizer st = new StringTokenizer ( str . replace ( '+' , ' ' ) , "&" ) ; while ( st . hasMoreTokens ( ) ) { String qp = st . nextToken ( ) ; String ...
Parses an RFC1630 query string into an existing Map .
9,352
public < E extends LogEntry > void writeTrace ( LogTrace < E > logTrace ) throws PerspectiveException , IOException { if ( logPerspective == LogPerspective . ACTIVITY_PERSPECTIVE ) throw new PerspectiveException ( PerspectiveError . WRITE_TRACE_IN_ACTIVITY_PERSPECTIVE ) ; prepare ( ) ; if ( ! headerWritten ) { write ( ...
This method is only allowed in the trace perspective .
9,353
public void writeEntry ( LogEntry logEntry , int caseNumber ) throws PerspectiveException , IOException { if ( logPerspective == LogPerspective . TRACE_PERSPECTIVE ) throw new PerspectiveException ( PerspectiveError . WRITE_ACTIVITY_IN_TRACE_PERSPECTIVE ) ; prepare ( ) ; if ( ! headerWritten ) { write ( logFormat . get...
This method is only allowed in the activity perspective .
9,354
public static VisitorData newVisitor ( ) { int visitorId = ( new SecureRandom ( ) . nextInt ( ) & 0x7FFFFFFF ) ; long now = now ( ) ; return new VisitorData ( visitorId , now , now , now , 1 ) ; }
initializes a new visitor data with new visitorid
9,355
public void addTrace ( LogTrace < E > trace ) throws ParameterException { Validate . notNull ( trace ) ; trace . setCaseNumber ( traces . size ( ) + 1 ) ; traces . add ( trace ) ; summary . addTrace ( trace ) ; if ( ! distinctTraces . add ( trace ) ) { for ( LogTrace < E > storedTrace : traces ) { if ( storedTrace . eq...
Adds a trace to the log .
9,356
public Double extractAmount ( XAttribute attribute ) { XAttribute attr = attribute . getAttributes ( ) . get ( KEY_AMOUNT ) ; if ( attr == null ) { return null ; } else { return ( ( XAttributeContinuous ) attr ) . getValue ( ) ; } }
Retrieves the cost amount for an attribute if set by this extension s amount attribute .
9,357
public Map < String , Double > extractAmounts ( XTrace trace ) { return XCostAmount . instance ( ) . extractValues ( trace ) ; }
Retrieves a map containing all cost amounts for all child attributes of a trace .
9,358
public Map < String , Double > extractAmounts ( XEvent event ) { return XCostAmount . instance ( ) . extractValues ( event ) ; }
Retrieves a map containing all cost amounts for all child attributes of an event .
9,359
public Map < List < String > , Double > extractNestedAmounts ( XTrace trace ) { return XCostAmount . instance ( ) . extractNestedValues ( trace ) ; }
Retrieves a map containing all cost amounts for all descending attributes of a trace .
9,360
public Map < List < String > , Double > extractNestedAmounts ( XEvent event ) { return XCostAmount . instance ( ) . extractNestedValues ( event ) ; }
Retrieves a map containing all cost amounts for all descending attributes of an event .
9,361
public void assignAmount ( XAttribute attribute , Double amount ) { if ( amount != null && amount > 0.0 ) { XAttributeContinuous attr = ( XAttributeContinuous ) ATTR_AMOUNT . clone ( ) ; attr . setValue ( amount ) ; attribute . getAttributes ( ) . put ( KEY_AMOUNT , attr ) ; } }
Assigns any attribute its cost amount as defined by this extension s amount attribute .
9,362
public String extractDriver ( XAttribute attribute ) { XAttribute attr = attribute . getAttributes ( ) . get ( KEY_DRIVER ) ; if ( attr == null ) { return null ; } else { return ( ( XAttributeLiteral ) attr ) . getValue ( ) ; } }
Retrieves the cost driver for an attribute if set by this extension s driver attribute .
9,363
public Map < String , String > extractDrivers ( XTrace trace ) { return XCostDriver . instance ( ) . extractValues ( trace ) ; }
Retrieves a map containing all cost drivers for all child attributes of a trace .
9,364
public Map < String , String > extractDrivers ( XEvent event ) { return XCostDriver . instance ( ) . extractValues ( event ) ; }
Retrieves a map containing all cost drivers for all child attributes of an event .
9,365
public Map < List < String > , String > extractNestedDrivers ( XTrace trace ) { return XCostDriver . instance ( ) . extractNestedValues ( trace ) ; }
Retrieves a map containing all cost drivers for all descending attributes of a trace .
9,366
public Map < List < String > , String > extractNestedDrivers ( XEvent event ) { return XCostDriver . instance ( ) . extractNestedValues ( event ) ; }
Retrieves a map containing all cost drivers for all descending attributes of an event .
9,367
public void assignDriver ( XAttribute attribute , String driver ) { if ( driver != null && driver . trim ( ) . length ( ) > 0 ) { XAttributeLiteral attr = ( XAttributeLiteral ) ATTR_DRIVER . clone ( ) ; attr . setValue ( driver ) ; attribute . getAttributes ( ) . put ( KEY_DRIVER , attr ) ; } }
Assigns any attribute its cost driver as defined by this extension s driver attribute .
9,368
public String extractType ( XAttribute attribute ) { XAttribute attr = attribute . getAttributes ( ) . get ( KEY_TYPE ) ; if ( attr == null ) { return null ; } else { return ( ( XAttributeLiteral ) attr ) . getValue ( ) ; } }
Retrieves the cost type for an attribute if set by this extension s type attribute .
9,369
public Map < String , String > extractTypes ( XTrace trace ) { return XCostType . instance ( ) . extractValues ( trace ) ; }
Retrieves a map containing all cost types for all child attributes of a trace .
9,370
public Map < String , String > extractTypes ( XEvent event ) { return XCostType . instance ( ) . extractValues ( event ) ; }
Retrieves a map containing all cost types for all child attributes of an event .
9,371
public Map < List < String > , String > extractNestedTypes ( XTrace trace ) { return XCostType . instance ( ) . extractNestedValues ( trace ) ; }
Retrieves a map containing all cost types for all descending attributes of a trace .
9,372
public Map < List < String > , String > extractNestedTypes ( XEvent event ) { return XCostType . instance ( ) . extractNestedValues ( event ) ; }
Retrieves a map containing all cost types for all descending attributes of an event .
9,373
public void assignType ( XAttribute attribute , String type ) { if ( type != null && type . trim ( ) . length ( ) > 0 ) { XAttributeLiteral attr = ( XAttributeLiteral ) ATTR_TYPE . clone ( ) ; attr . setValue ( type ) ; attribute . getAttributes ( ) . put ( KEY_TYPE , attr ) ; } }
Assigns any attribute its cost type as defined by this extension s type attribute .
9,374
public Date extractTimestamp ( XEvent event ) { XAttributeTimestamp timestampAttribute = ( XAttributeTimestamp ) event . getAttributes ( ) . get ( KEY_TIMESTAMP ) ; if ( timestampAttribute == null ) { return null ; } else { return timestampAttribute . getValue ( ) ; } }
Extracts from a given event the timestamp .
9,375
public void assignTimestamp ( XEvent event , long time ) { XAttributeTimestamp attr = ( XAttributeTimestamp ) ATTR_TIMESTAMP . clone ( ) ; attr . setValueMillis ( time ) ; event . getAttributes ( ) . put ( KEY_TIMESTAMP , attr ) ; }
Assigns to a given event its timestamp .
9,376
public synchronized MappedByteBuffer requestMap ( NikeFS2BlockProvider requester ) throws IOException { for ( int i = 0 ; i < currentShadowSize ; i ++ ) { if ( currentMapOwners [ i ] == requester ) { lastRequestIndex = i ; return centralMaps [ i ] ; } } if ( currentShadowSize < shadowSize ) { currentMapOwners [ current...
Grants access to the mapped byte buffer on the backing file for a block provider . This static method implements the backing file manager which ensures that only a limited number of backing files and associated mapped byte buffers are concurrently in use .
9,377
public int doEndTag ( ) throws JspException { boolean usingDefault = false ; boolean bypassEscape = false ; String scriptId = null ; ServletRequest req = pageContext . getRequest ( ) ; Object labelObject = null ; String labelValue = null ; if ( _value != null ) labelObject = _value ; else { if ( _defaultValue != null )...
Render the label .
9,378
public void addFilter ( AbstractLogFilter < E > filter ) { Validate . notNull ( filter ) ; filters . add ( filter ) ; uptodate = false ; filter . addObserver ( this ) ; }
Adds a new filter to the view .
9,379
public void removeFilter ( AbstractLogFilter < E > filter ) { Validate . notNull ( filter ) ; filters . remove ( filter ) ; uptodate = false ; filter . deleteObserver ( this ) ; }
Removes a filter to the view .
9,380
private void update ( ) { if ( ! uptodate ) { summary . clear ( ) ; distinctTraces . clear ( ) ; traces . clear ( ) ; addTraces ( allTraces , false ) ; uptodate = true ; } }
Updates the summary set of distinct traces and list of traces if the filter set has been changed .
9,381
public final void setStartDate ( Date startDate ) { if ( this . startDate == null || ! this . startDate . equals ( startDate ) ) { if ( startDate != null && endDate != null && endDate . before ( startDate ) ) { throw new ParameterException ( "The start date must be before the end date of the filter." ) ; } this . start...
Sets the start date .
9,382
public final void setEndDate ( Date endDate ) { if ( this . endDate == null || ! this . endDate . equals ( endDate ) ) { if ( endDate != null && startDate != null && endDate . before ( startDate ) ) { throw new ParameterException ( "The start date must be before the end date of the filter." ) ; } this . endDate = endDa...
Sets the end date .
9,383
public TimeFrameFilterType getType ( ) { if ( startDate == null && endDate == null ) { return TimeFrameFilterType . INOPERATIVE ; } else if ( startDate != null && endDate == null ) { return TimeFrameFilterType . MIN_DATE ; } else if ( startDate == null && endDate != null ) { return TimeFrameFilterType . MAX_DATE ; } el...
Returns the type of the time filter .
9,384
public Object read ( Object object ) { if ( object == null ) { String msg = "Can not evaluate the identifier \"" + _identifier + "\" on a null object." ; LOGGER . error ( msg ) ; throw new RuntimeException ( msg ) ; } if ( TRACE_ENABLED ) LOGGER . trace ( "Read property " + _identifier + " on object of type " + object ...
Read the object represetned by this token from the given object .
9,385
public XID extractID ( XAttributable element ) { XAttribute attribute = element . getAttributes ( ) . get ( KEY_ID ) ; if ( attribute == null ) { return null ; } else { return ( ( XAttributeID ) attribute ) . getValue ( ) ; } }
Retrieves the id of a log data hierarchy element if set by this extension s id attribute .
9,386
public void assignID ( XAttributable element , XID id ) { if ( id != null ) { XAttributeID attr = ( XAttributeID ) ATTR_ID . clone ( ) ; attr . setValue ( id ) ; element . getAttributes ( ) . put ( KEY_ID , attr ) ; } }
Assigns any log data hierarchy element its id as defined by this extension s id attribute .
9,387
void mergeDependsList ( Element element ) { String depends = getElementAttribute ( element , "depends" ) ; StringBuffer updatedDepends = new StringBuffer ( ) ; if ( depends != null ) { updatedDepends . append ( depends ) ; } else { depends = "" ; } ArrayList rules = new ArrayList ( ) ; for ( Iterator i = _rules . itera...
Merge the rule names with the list in the field element s depends attribute .
9,388
void setDefaultArg0Element ( XmlModelWriter xw , String displayName , boolean displayNameIsResource , Element element ) { Element defaultArg0Element = getArgElement ( xw , element , 0 , null , _rules . size ( ) > 0 ) ; if ( defaultArg0Element != null ) { setElementAttribute ( defaultArg0Element , "key" , displayName ) ...
Find or create a default arg 0 element not associated with a specific rule and set it to the display name .
9,389
void setRuleMessage ( XmlModelWriter xw , ValidatorRule rule , Element element ) { String messageKey = rule . getMessageKey ( ) ; String message = rule . getMessage ( ) ; if ( messageKey != null || message != null ) { Element msgElementToUse = findChildElement ( xw , element , "msg" , "name" , rule . getRuleName ( ) , ...
Set up the desired &lt ; msg&gt ; element and attributes for the given rule .
9,390
void setRuleArg ( XmlModelWriter xw , ValidatorRule rule , int argNum , Element element , String altMessageVar ) { Integer argPosition = new Integer ( argNum ) ; ValidatorRule . MessageArg arg = rule . getArg ( argPosition ) ; if ( arg != null || altMessageVar != null ) { String ruleName = rule . getRuleName ( ) ; Elem...
Set up the desired &lt ; arg&gt ; element and attributes for the given rule .
9,391
public void setTitle ( String title ) { _spanState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . TITLE , title ) ; }
Sets the value of the title attribute for the HTML span .
9,392
public void setLang ( String lang ) { _spanState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . LANG , lang ) ; }
Sets the lang attribute for the HTML span .
9,393
public void setDir ( String dir ) { _spanState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . DIR , dir ) ; }
Sets the dir attribute for the HTML span .
9,394
protected void renderDataCellContents ( AbstractRenderAppender appender , String jspFragmentOutput ) { if ( _spanState . id != null ) { HttpServletRequest request = JspUtil . getRequest ( getJspContext ( ) ) ; String script = renderNameAndId ( request , _spanState , null ) ; if ( script != null ) _spanCellModel . setJa...
Render the cell s contents . This method implements support for executing the span cell s decorator .
9,395
public void removeFromSession ( HttpServletRequest request ) { StorageHandler sh = Handlers . get ( getServletContext ( ) ) . getStorageHandler ( ) ; HttpServletRequest unwrappedRequest = PageFlowUtils . unwrapMultipart ( request ) ; RequestContext rc = new RequestContext ( unwrappedRequest , null ) ; String attrName =...
Remove this instance from the session .
9,396
public void reinitialize ( HttpServletRequest request , HttpServletResponse response , ServletContext servletContext ) { super . reinitialize ( request , response , servletContext ) ; if ( _pageInputs == null ) { Map map = InternalUtils . getActionOutputMap ( request , false ) ; if ( map != null ) _pageInputs = Collect...
Reinitialize the bean for a new request . Used by the framework ; normally should not be called directly .
9,397
protected Object getPageInput ( String pageInputName ) { return _pageInputs != null ? _pageInputs . get ( pageInputName ) : null ; }
Get a page input that was passed from a Page Flow action as an action output .
9,398
public int convertStringToSQLType ( String type ) { if ( _typeSqlNameMap . containsKey ( type . toUpperCase ( ) ) ) { return _typeSqlNameMap . get ( type . toUpperCase ( ) ) ; } return TYPE_UNKNOWN ; }
Convert a type string to its SQL Type int value .
9,399
public int getSqlType ( Class classType ) { final Class origType = classType ; while ( classType != null ) { Integer type = _typeSqlMap . get ( classType ) ; if ( type != null ) { return type . intValue ( ) ; } classType = classType . getSuperclass ( ) ; } if ( Blob . class . isAssignableFrom ( origType ) ) { return _t...
Get the SQL type of a class start at top level class an check all super classes until match is found .