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 ( ) ; HttpServletRequest request = getRequest ( ) ; HttpServletResponse response = getResponse ( ) ; return PageFlowUtils . getRewrittenActionURI ( servletContext , request , response , actionName , parameters , null , asValidXml ) ; } | 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 ( ) ) ; if ( url == null && factory == null ) { try { return new InitialContext ( ) ; } catch ( NamingException e ) { throw new ControlException ( "Cannot get default JNDI initial context" , e ) ; } } if ( url == null || factory == null ) { throw new ControlException ( "Both the provider-url and jndi factory need to be provided" ) ; } Hashtable < String , String > env = new Hashtable < String , String > ( ) ; env . put ( javax . naming . Context . INITIAL_CONTEXT_FACTORY , factory ) ; env . put ( javax . naming . Context . PROVIDER_URL , url ) ; String username = nullIfEmpty ( props . jndiSecurityPrincipal ( ) ) ; if ( username != null ) env . put ( javax . naming . Context . SECURITY_PRINCIPAL , username ) ; String password = nullIfEmpty ( props . jndiSecurityCredentials ( ) ) ; if ( password != null ) env . put ( javax . naming . Context . SECURITY_CREDENTIALS , password ) ; try { return _initialContext = new InitialContext ( env ) ; } catch ( NamingException e ) { throw new ControlException ( "Cannot get JNDI initial context at provider '" + url + "' with factory '" + factory + "'" , e ) ; } } | 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 = typeMap . get ( XAttributeUtils . getType ( prototype ) ) ; if ( typeSet == null ) { typeSet = new HashSet < XAttribute > ( ) ; typeMap . put ( XAttributeUtils . getType ( prototype ) , typeSet ) ; } typeSet . add ( prototype ) ; if ( attribute . getExtension ( ) == null ) { noExtensionSet . add ( prototype ) ; } else { Set < XAttribute > extensionSet = extensionMap . get ( attribute . getExtension ( ) ) ; if ( extensionSet == null ) { extensionSet = new HashSet < XAttribute > ( ) ; extensionMap . put ( attribute . getExtension ( ) , extensionSet ) ; } extensionSet . add ( prototype ) ; } } else { frequencies . put ( attribute . getKey ( ) , frequencies . get ( attribute . getKey ( ) ) + 1 ) ; } totalFrequency ++ ; } | 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." ) ; } _templates . put ( templateName , template ) ; } | 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 new IllegalArgumentException ( "Template Reference Group cannot be null or empty." ) ; } _templateRefGroups . put ( refGroupName , templateRefGroup ) ; } | 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 > currentConstraintNames = getConstraintNames ( activity ) ; currentConstraintNames . add ( propertyNameForNewConstraint ) ; if ( currentConstraintNames . size ( ) == 1 ) { addActivityWithConstraints ( activity ) ; } props . setProperty ( String . format ( ACTIVITY_CONSTRAINTS_FORMAT , activity ) , ArrayUtils . toString ( currentConstraintNames . toArray ( ) ) ) ; } | 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 , ArrayUtils . toString ( currentActivities . toArray ( ) ) ) ; } | 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_CONSTRAINTS , ArrayUtils . toString ( currentActivities . toArray ( ) ) ) ; } | 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 ( propertyValue , " " ) ; while ( activityTokens . hasMoreTokens ( ) ) { result . add ( activityTokens . nextToken ( ) ) ; } return result ; } | 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 ( constraintName ) ) ; } return result ; } | 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 = TagRenderingBase . Factory . getRendering ( TagRenderingBase . TD_TAG , request ) ; _htmlConstantRendering = TagRenderingBase . Factory . getConstantRendering ( request ) ; _sb = new InternalStringBuilder ( 1024 ) ; _appender = new StringBuilderRenderAppender ( _sb ) ; Object source = evaluateDataSource ( ) ; if ( hasErrors ( ) ) return SKIP_BODY ; if ( source != null ) { Iterator iterator = IteratorFactory . createIterator ( source ) ; if ( iterator == null ) { LOGGER . info ( "CellRepeater: The data structure from which to create an iterator is null." ) ; iterator = Collections . EMPTY_LIST . iterator ( ) ; } if ( iterator != null ) { _dataList = new ArrayList ( ) ; while ( iterator . hasNext ( ) ) { _dataList . add ( iterator . next ( ) ) ; } } } if ( _rows == DIMENSION_DEFAULT_VALUE || _columns == DIMENSION_DEFAULT_VALUE ) { if ( _dataList != null && _dataList . size ( ) > 0 ) { guessDimensions ( _dataList ) ; if ( hasErrors ( ) ) return SKIP_BODY ; } else { _valid = false ; return SKIP_BODY ; } } if ( _rows <= 0 ) { String msg = Bundle . getString ( "Tags_CellRepeater_invalidRowValue" , new Object [ ] { getTagName ( ) , new Integer ( _rows ) } ) ; registerTagError ( msg , null ) ; } if ( _columns <= 0 ) { String msg = Bundle . getString ( "Tags_CellRepeater_invalidColumnValue" , new Object [ ] { getTagName ( ) , new Integer ( _columns ) } ) ; registerTagError ( msg , null ) ; } if ( hasErrors ( ) ) return SKIP_BODY ; openTableTag ( _appender , _tableState ) ; _currentRow = 0 ; _currentColumn = 0 ; DataAccessProviderStack . addDataAccessProvider ( this , pageContext ) ; _containerInPageContext = true ; boolean haveItem = ensureItem ( 0 , _dataList ) ; if ( haveItem ) { openRowTag ( _appender , _trState ) ; openCellTag ( _appender , _currentColumn ) ; return EVAL_BODY_BUFFERED ; } else { for ( int i = 0 ; i < _rows ; i ++ ) { openRowTag ( _appender , _trState ) ; for ( int j = 0 ; j < _columns ; j ++ ) { openCellTag ( _appender , computeStyleIndex ( i , j ) ) ; _htmlConstantRendering . NBSP ( _appender ) ; closeCellTag ( _appender ) ; } closeRowTag ( _appender ) ; _appender . append ( "\n" ) ; } _currentRow = _rows ; _currentColumn = _columns ; return SKIP_BODY ; } } | 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 Object [ ] { getTagName ( ) } ) ) ; throw uoe ; } | 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 ) ; } for ( String activity : activities ) { removeDataUsageFor ( activity , attribute ) ; } if ( notifyListeners ) { contextListenerSupport . notifyObjectRemoved ( attribute ) ; } return true ; } | 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 ) ) ; } return result ; } | 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 . getInputStream ( ) ; final String W3C_XML_SCHEMA = "http://www.w3.org/2001/XMLSchema" ; final String JAXP_SCHEMA_LANGUAGE = "http://java.sun.com/xml/jaxp/properties/schemaLanguage" ; final String JAXP_SCHEMA_SOURCE = "http://java.sun.com/xml/jaxp/properties/schemaSource" ; DocumentBuilderFactory dbf = DocumentBuilderFactory . newInstance ( ) ; dbf . setValidating ( true ) ; dbf . setNamespaceAware ( true ) ; dbf . setAttribute ( JAXP_SCHEMA_LANGUAGE , W3C_XML_SCHEMA ) ; dbf . setAttribute ( JAXP_SCHEMA_SOURCE , xsdInputStream ) ; DocumentBuilder db = dbf . newDocumentBuilder ( ) ; db . setErrorHandler ( new ErrorHandler ( ) { public void warning ( SAXParseException exception ) { _log . info ( "Validation warning validating config file \"" + _configFilePath + "\" against XML Schema \"" + SCHEMA_RESOLVER . getResourcePath ( ) ) ; } public void error ( SAXParseException exception ) { _log . error ( "Validation errors occurred parsing the config file \"" + _configFilePath + "\". Cause: " + exception , exception ) ; } public void fatalError ( SAXParseException exception ) { _log . error ( "Validation errors occurred parsing the config file \"" + _configFilePath + "\". Cause: " + exception , exception ) ; } } ) ; db . setEntityResolver ( new EntityResolver ( ) { public InputSource resolveEntity ( String publicId , String systemId ) { if ( systemId . endsWith ( "/url-template-config.xsd" ) ) { InputStream inputStream = DefaultURLTemplatesFactory . class . getClassLoader ( ) . getResourceAsStream ( CONFIG_SCHEMA ) ; return new InputSource ( inputStream ) ; } else return null ; } } ) ; Document document = db . parse ( xmlInputStream ) ; Element root = document . getDocumentElement ( ) ; loadTemplates ( root ) ; loadTemplateRefGroups ( root ) ; } else { if ( _log . isInfoEnabled ( ) ) _log . info ( "Running without URL template descriptor, " + _configFilePath ) ; } } catch ( ParserConfigurationException pce ) { _log . error ( "Problem loading URL template descriptor file " + _configFilePath , pce ) ; } catch ( SAXException se ) { _log . error ( "Problem parsing URL template descriptor in " + _configFilePath , se ) ; } catch ( IOException ioe ) { _log . error ( "Problem reading URL template descriptor file " + _configFilePath , ioe ) ; } finally { try { if ( xmlInputStream != null ) xmlInputStream . close ( ) ; } catch ( Exception ignore ) { } try { if ( xsdInputStream != null ) xsdInputStream . close ( ) ; } catch ( IOException ignore ) { } } } | 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 . error ( "Malformed URL template descriptor in " + _configFilePath + ". The url-template name is missing." ) ; continue ; } String value = getElementText ( template , VALUE ) ; if ( value == null ) { _log . error ( "Malformed URL template descriptor in " + _configFilePath + ". The url-template value is missing for template " + name ) ; continue ; } if ( _log . isDebugEnabled ( ) ) { _log . debug ( "[URLTemplate] " + name + " = " + value ) ; } URLTemplate urlTemplate = new URLTemplate ( value , name ) ; if ( urlTemplate . verify ( _knownTokens , _requiredTokens ) ) { _urlTemplates . addTemplate ( name , urlTemplate ) ; } } } | 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 = getElementText ( refGroupElement , NAME ) ; if ( refGroupName == null ) { _log . error ( "Malformed URL template descriptor in " + _configFilePath + ". The url-template-ref-group name is missing." ) ; continue ; } HashMap refGroup = new HashMap ( ) ; List templateRefs = DomUtils . getChildElementsByName ( refGroupElement , URL_TEMPLATE_REF ) ; ; for ( int j = 0 ; j < templateRefs . size ( ) ; j ++ ) { Element templateRefElement = ( Element ) templateRefs . get ( j ) ; String key = getElementText ( templateRefElement , KEY ) ; if ( key == null ) { _log . error ( "Malformed URL template descriptor in " + _configFilePath + ". The url-template-ref key is missing in url-template-ref-group " + refGroupName ) ; continue ; } String name = getElementText ( templateRefElement , TEMPLATE_NAME ) ; if ( name != null ) { refGroup . put ( key , name ) ; if ( _log . isDebugEnabled ( ) ) { _log . debug ( "[" + refGroupName + " URLTemplate] " + key + " = " + name ) ; } } else { _log . error ( "Malformed URL template descriptor in " + _configFilePath + ". The url-template-ref template-name is missing in url-template-ref-group " + refGroupName ) ; } } if ( refGroup . size ( ) != 0 ) { _urlTemplates . addTemplateRefGroup ( refGroupName , refGroup ) ; } } } | 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 . getJSONObject ( "token" ) . isNullObject ( ) ) { return loginWithAccessToken ( token . getJSONObject ( "token" ) . getString ( "oauth_token" ) , token . getJSONObject ( "token" ) . getString ( "oauth_token_secret" ) ) ; } else { throw new Unauthorized ( "Could not get Request 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 ) ) ; sb . append ( setName . substring ( setName . lastIndexOf ( '.' ) + 1 ) ) ; sb . append ( "EventAdaptor" ) ; return sb . toString ( ) ; } | 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 ( "<" ) ; isFirst = false ; } else sb . append ( ", " ) ; String typeName = tpd . getSimpleName ( ) ; if ( typeBinding . containsKey ( typeName ) ) sb . append ( typeBinding . get ( tpd . getSimpleName ( ) ) ) ; else sb . append ( "java.lang.Object" ) ; } if ( ! isFirst ) sb . append ( ">" ) ; return sb . toString ( ) ; } | 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 ( moduleConfigPath ) != null ) return moduleConfigPath ; } catch ( MalformedURLException e ) { _log . error ( "ModuleConfigLocator " + locator . getClass ( ) . getName ( ) + " returned an invalid path: " + moduleConfigPath + '.' , e ) ; } } } return null ; } | 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 = new InternalStringBuilder ( "Dynamically registering module " ) . append ( modulePath ) ; _log . info ( msg . append ( ", config XML " ) . append ( configFilePath ) . toString ( ) ) ; } if ( _cachedConfigDigester == null ) { _cachedConfigDigester = initConfigDigester ( ) ; } configDigester = _cachedConfigDigester ; ModuleConfig ac = initModuleConfig ( modulePath , configFilePath ) ; initModuleMessageResources ( ac ) ; initModuleDataSources ( ac ) ; initModulePlugIns ( ac ) ; ac . freeze ( ) ; configDigester = null ; ControllerConfig cc = ac . getControllerConfig ( ) ; if ( cc instanceof PageFlowControllerConfig ) { PageFlowControllerConfig pfcc = ( PageFlowControllerConfig ) cc ; PageFlowEventReporter er = AdapterManager . getServletContainerAdapter ( getServletContext ( ) ) . getEventReporter ( ) ; er . flowControllerRegistered ( modulePath , pfcc . getControllerClass ( ) , ac ) ; } InternalUtils . initDelegatingConfigs ( ac , getServletContext ( ) ) ; if ( _log . isDebugEnabled ( ) ) { _log . debug ( "Finished registering module " + modulePath + ", config XML " + configFilePath ) ; } return ac ; } | 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 ) ; servletContext . removeAttribute ( Globals . REQUEST_PROCESSOR_KEY + modulePrefix ) ; } _registeredModules . clear ( ) ; } | 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." ; HttpServletRequest request = ( HttpServletRequest ) context . getRequest ( ) ; if ( prevPageInfo == null ) { if ( _log . isInfoEnabled ( ) ) { _log . info ( "Attempted return-to-page, but previous page info was missing." ) ; } PageFlowException ex = new NoPreviousPageException ( actionName , pageFlowFwd , currentPageFlow ) ; InternalUtils . throwPageFlowException ( ex , request ) ; } ActionForward retFwd = prevPageInfo . getForward ( ) ; ActionMapping prevMapping = prevPageInfo . getMapping ( ) ; if ( retFwd instanceof Forward ) { PageFlowUtils . setOutputForms ( prevMapping , ( Forward ) retFwd , request , false ) ; InternalUtils . addActionOutputs ( ( ( Forward ) retFwd ) . getActionOutputs ( ) , request , false ) ; } if ( prevMapping != null ) { if ( currentForm != null ) PageFlowUtils . setOutputForm ( prevMapping , currentForm , request , false ) ; InternalUtils . setFormInScope ( prevMapping . getName ( ) , prevPageInfo . getForm ( ) , prevMapping , request , false ) ; } FlowController flowController = context . getFlowController ( ) ; if ( ! retFwd . getContextRelative ( ) && flowController != currentPageFlow ) { retFwd = new ActionForward ( retFwd . getName ( ) , currentPageFlow . getModulePath ( ) + retFwd . getPath ( ) , retFwd . getRedirect ( ) , true ) ; } if ( _log . isDebugEnabled ( ) ) { _log . debug ( "Return-to-page in PageFlowController " + flowController . getClass ( ) . getName ( ) + ": original URI " + retFwd . getPath ( ) ) ; } if ( retFwd != null ) { if ( pageFlowFwd . hasExplicitRedirectValue ( ) ) retFwd . setRedirect ( pageFlowFwd . getRedirect ( ) ) ; String fwdPath = retFwd . getPath ( ) ; String newQueryString = pageFlowFwd . getQueryString ( ) ; int existingQueryPos = fwdPath . indexOf ( '?' ) ; if ( newQueryString != null ) { if ( existingQueryPos != - 1 ) fwdPath = fwdPath . substring ( 0 , existingQueryPos ) ; retFwd . setPath ( fwdPath + newQueryString ) ; } else if ( existingQueryPos == - 1 ) { retFwd . setPath ( fwdPath + getQueryString ( pageFlowFwd , prevPageInfo ) ) ; } } PageFlowRequestWrapper . get ( request ) . setPreviousPageInfo ( prevPageInfo ) ; return retFwd ; } | 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 [ ] pair = qp . split ( "=" ) ; res . put ( unescape ( pair [ 0 ] , encoding ) , unescape ( pair [ 1 ] , encoding ) ) ; } } | 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 ( logFormat . getFileHeader ( ) ) ; headerWritten = true ; } output . write ( logFormat . getTraceAsString ( logTrace ) ) ; } | 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 . getFileHeader ( ) ) ; headerWritten = true ; } output . write ( logFormat . getEntryAsString ( logEntry , caseNumber ) ) ; } | 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 . equals ( trace ) ) { storedTrace . addSimilarInstance ( trace . getCaseNumber ( ) ) ; trace . addSimilarInstance ( storedTrace . getCaseNumber ( ) ) ; } } } } | 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 [ currentShadowSize ] = requester ; currentMapRandomAccessFiles [ currentShadowSize ] = new RandomAccessFile ( requester . getFile ( ) , "rw" ) ; currentMapFileChannels [ currentShadowSize ] = currentMapRandomAccessFiles [ currentShadowSize ] . getChannel ( ) ; MappedByteBuffer map = currentMapFileChannels [ currentShadowSize ] . map ( FileChannel . MapMode . READ_WRITE , 0 , requester . size ( ) ) ; centralMaps [ currentShadowSize ] = map ; lastRequestIndex = currentShadowSize ; currentShadowSize ++ ; XLogging . log ( "NikeFS2: Populating shadow map " + currentShadowSize + " (of " + shadowSize + " max.)" , Importance . DEBUG ) ; return map ; } else { int kickIndex = lastRequestIndex + 1 ; if ( kickIndex == shadowSize ) { kickIndex = 0 ; } centralMaps [ kickIndex ] . force ( ) ; centralMaps [ kickIndex ] = null ; currentMapFileChannels [ kickIndex ] . close ( ) ; currentMapFileChannels [ kickIndex ] = null ; currentMapRandomAccessFiles [ kickIndex ] . close ( ) ; currentMapRandomAccessFiles [ kickIndex ] = null ; System . gc ( ) ; currentMapOwners [ kickIndex ] = requester ; currentMapRandomAccessFiles [ kickIndex ] = new RandomAccessFile ( requester . getFile ( ) , "rw" ) ; currentMapFileChannels [ kickIndex ] = currentMapRandomAccessFiles [ kickIndex ] . getChannel ( ) ; MappedByteBuffer map = currentMapFileChannels [ kickIndex ] . map ( FileChannel . MapMode . READ_WRITE , 0 , requester . size ( ) ) ; centralMaps [ kickIndex ] = map ; lastRequestIndex = kickIndex ; XLogging . log ( "NikeFS2: Displacing shadow map " + ( kickIndex + 1 ) , Importance . DEBUG ) ; return map ; } } | 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 ) { labelObject = _defaultValue ; bypassEscape = HtmlUtils . containsEntity ( _defaultValue . toString ( ) ) ; } else { logger . warn ( Bundle . getString ( "Tags_LabelExpressionNull" , _value ) ) ; labelObject = DEFAULT_NULL_TEXT ; } usingDefault = true ; } if ( _state . id != null ) { scriptId = renderNameAndId ( ( HttpServletRequest ) req , _state , null ) ; } labelValue = ( usingDefault && ! _formatDefaultValue ) ? labelObject . toString ( ) : formatText ( labelObject ) ; if ( hasErrors ( ) ) return reportAndExit ( EVAL_PAGE ) ; if ( _state . forAttr != null ) { _state . forAttr = getIdForTagId ( _state . forAttr ) ; } WriteRenderAppender writer = new WriteRenderAppender ( pageContext ) ; TagRenderingBase br = TagRenderingBase . Factory . getRendering ( TagRenderingBase . LABEL_TAG , req ) ; br . doStartTag ( writer , _state ) ; if ( ! bypassEscape ) filter ( labelValue , writer , _escapeWhiteSpace ) ; else write ( labelValue ) ; br . doEndTag ( writer ) ; if ( scriptId != null ) write ( scriptId ) ; localRelease ( ) ; return EVAL_PAGE ; } | 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 . startDate = startDate ; setChanged ( ) ; notifyObservers ( ) ; } } | 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 = endDate ; setChanged ( ) ; notifyObservers ( ) ; } } | 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 ; } else { return TimeFrameFilterType . TIMEFRAME ; } } | 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 . getClass ( ) . getName ( ) ) ; if ( object instanceof Map ) return mapLookup ( ( Map ) object , _identifier ) ; else if ( object instanceof List ) { int i = parseIndex ( _identifier ) ; return listLookup ( ( List ) object , i ) ; } else if ( object . getClass ( ) . isArray ( ) ) { int i = parseIndex ( _identifier ) ; return arrayLookup ( object , i ) ; } else return beanLookup ( object , _identifier ) ; } | 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 . iterator ( ) ; i . hasNext ( ) ; ) { ValidatorRule rule = ( ValidatorRule ) i . next ( ) ; String name = rule . getRuleName ( ) ; if ( depends . indexOf ( name ) == - 1 ) rules . add ( name ) ; } Collections . sort ( rules ) ; for ( Iterator i = rules . iterator ( ) ; i . hasNext ( ) ; ) { if ( updatedDepends . length ( ) > 0 ) updatedDepends . append ( ',' ) ; updatedDepends . append ( ( String ) i . next ( ) ) ; } if ( updatedDepends . length ( ) != 0 ) { element . setAttribute ( "depends" , updatedDepends . toString ( ) ) ; } } | 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 ) ; setElementAttribute ( defaultArg0Element , "resource" , Boolean . toString ( displayNameIsResource ) ) ; defaultArg0Element . removeAttribute ( "bundle" ) ; } } | 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 ( ) , true , null ) ; setElementAttribute ( msgElementToUse , "resource" , true ) ; if ( messageKey != null ) { setElementAttribute ( msgElementToUse , "key" , messageKey ) ; if ( _isValidatorOneOne ) { setElementAttribute ( msgElementToUse , "bundle" , rule . getBundle ( ) ) ; } } else { setElementAttribute ( msgElementToUse , "key" , ValidatorConstants . EXPRESSION_KEY_PREFIX + message ) ; } } } | Set up the desired < ; msg> ; 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 ( ) ; Element argElementToUse = getArgElement ( xw , element , argNum , ruleName , true ) ; if ( arg != null ) { String argMessage = arg . getMessage ( ) ; String key = arg . isKey ( ) ? argMessage : ValidatorConstants . EXPRESSION_KEY_PREFIX + argMessage ; setElementAttribute ( argElementToUse , "key" , key ) ; setElementAttribute ( argElementToUse , "resource" , true ) ; if ( arg . isKey ( ) && _isValidatorOneOne ) { setElementAttribute ( argElementToUse , "bundle" , rule . getBundle ( ) ) ; } } else { altMessageVar = "${var:" + altMessageVar + '}' ; setElementAttribute ( argElementToUse , "key" , altMessageVar ) ; setElementAttribute ( argElementToUse , "resource" , "false" ) ; } setElementAttribute ( argElementToUse , "name" , ruleName ) ; } } | Set up the desired < ; arg> ; 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 . setJavascript ( script ) ; } DECORATOR . decorate ( getJspContext ( ) , appender , _spanCellModel ) ; } | 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 = ScopedServletUtils . getScopedSessionAttrName ( InternalConstants . FACES_BACKING_ATTR , unwrappedRequest ) ; sh . removeAttribute ( rc , 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 = Collections . unmodifiableMap ( map ) ; } Field pageFlowMemberField = getCachedInfo ( ) . getPageFlowMemberField ( ) ; if ( fieldIsUninitialized ( pageFlowMemberField ) ) { PageFlowController pfc = PageFlowUtils . getCurrentPageFlow ( request , servletContext ) ; initializeField ( pageFlowMemberField , pfc ) ; } CachedSharedFlowRefInfo . SharedFlowFieldInfo [ ] sharedFlowMemberFields = getCachedInfo ( ) . getSharedFlowMemberFields ( ) ; if ( sharedFlowMemberFields != null ) { for ( int i = 0 ; i < sharedFlowMemberFields . length ; i ++ ) { CachedSharedFlowRefInfo . SharedFlowFieldInfo fi = sharedFlowMemberFields [ i ] ; Field field = fi . field ; if ( fieldIsUninitialized ( field ) ) { Map sharedFlows = PageFlowUtils . getSharedFlows ( request ) ; String name = fi . sharedFlowName ; SharedFlowController sf = name != null ? ( SharedFlowController ) sharedFlows . get ( name ) : PageFlowUtils . getGlobalApp ( request ) ; if ( sf != null ) { initializeField ( field , sf ) ; } else { _log . error ( "Could not find shared flow with name \"" + fi . sharedFlowName + "\" to initialize field " + field . getName ( ) + " in " + getClass ( ) . getName ( ) ) ; } } } } } | 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 _typeSqlMap . get ( Blob . class ) . intValue ( ) ; } else if ( Clob . class . isAssignableFrom ( origType ) ) { return _typeSqlMap . get ( Clob . class ) . intValue ( ) ; } return Types . OTHER ; } | Get the SQL type of a class start at top level class an check all super classes until match is found . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.