idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
9,700 | public void setOnMouseOut ( String onMouseOut ) { _tbodyTag . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , HtmlConstants . ONMOUSEOUT , onMouseOut ) ; } | Sets the onMouseOut JavaScript event for the HTML tbody tag . |
9,701 | public void setOnMouseOver ( String onMouseOver ) { _tbodyTag . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , HtmlConstants . ONMOUSEOVER , onMouseOver ) ; } | Sets the onMouseOver JavaScript event for the HTML tbody tag . |
9,702 | public void setAlign ( String align ) { _tbodyTag . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . ALIGN , align ) ; } | Sets the value of the horizontal alignment attribute of the HTML tbody tag . |
9,703 | public void setCharoff ( String alignCharOff ) { _tbodyTag . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . CHAROFF , alignCharOff ) ; } | Sets the value of the horizontal alignment character offset attribute . |
9,704 | public void setValign ( String align ) { _tbodyTag . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . VALIGN , align ) ; } | Sets the value of the vertical alignment attribute of the HTML tbody tag . |
9,705 | public static boolean isInteger ( String number ) { boolean result = false ; try { Integer . parseInt ( number ) ; result = true ; } catch ( NumberFormatException e ) { } return result ; } | Checks if a string is a valid integer |
9,706 | public static boolean isLong ( String number ) { boolean result = false ; try { Long . parseLong ( number ) ; result = true ; } catch ( NumberFormatException e ) { } return result ; } | Checks if a string is a valid long |
9,707 | public static boolean isDouble ( String number ) { boolean result = false ; if ( number != null ) { try { Double . parseDouble ( number ) ; result = true ; } catch ( NumberFormatException e ) { } } return result ; } | Checks if a string is a valid Double |
9,708 | public static boolean isBoolean ( String number ) { boolean result = false ; if ( number != null && ( number . equalsIgnoreCase ( "true" ) || number . equalsIgnoreCase ( "false" ) ) ) { result = true ; } return result ; } | Checks if a string is a valid boolean |
9,709 | public static boolean isValidDouble ( String number ) { boolean valid = false ; if ( isDouble ( number ) && isPositive ( Double . parseDouble ( number ) ) ) { valid = true ; } return valid ; } | Checks if a string is a valid double . |
9,710 | public static ScopedRequest getScopedRequest ( HttpServletRequest realRequest , String overrideURI , ServletContext servletContext , Object scopeKey , boolean seeOuterRequestAttributes ) { assert ! ( realRequest instanceof ScopedRequest ) ; String requestAttr = getScopedName ( OVERRIDE_REQUEST_ATTR , scopeKey ) ; Scope... | Get the cached ScopedRequest wrapper . If none exists creates one and caches it . |
9,711 | public static ScopedResponse getScopedResponse ( HttpServletResponse realResponse , ScopedRequest scopedRequest ) { assert ! ( realResponse instanceof ScopedResponse ) ; String responseAttr = getScopedName ( OVERRIDE_RESPONSE_ATTR , scopedRequest . getScopeKey ( ) ) ; HttpServletRequest outerRequest = scopedRequest . g... | Get the cached wrapper servlet response . If none exists creates one and caches it . |
9,712 | public static ScopedRequest unwrapRequest ( ServletRequest request ) { if ( request instanceof MultipartRequestWrapper ) { request = ( ( MultipartRequestWrapper ) request ) . getRequest ( ) ; } while ( request instanceof ServletRequestWrapper ) { if ( request instanceof ScopedRequest ) { return ( ScopedRequest ) reques... | Unwraps the contained ScopedRequest from the given ServletRequest which may be a ServletRequestWrapper . |
9,713 | public static ScopedResponse unwrapResponse ( ServletResponse response ) { while ( response instanceof ServletResponseWrapper ) { if ( response instanceof ScopedResponse ) { return ( ScopedResponse ) response ; } else { response = ( ( ServletResponseWrapper ) response ) . getResponse ( ) ; } } return null ; } | Unwraps the contained ScopedResponseImpl from the given ServletResponse which may be a ServletResponseWrapper . |
9,714 | public static String getScopedSessionAttrName ( String attrName , HttpServletRequest request ) { String requestScopeParam = request . getParameter ( SCOPE_ID_PARAM ) ; if ( requestScopeParam != null ) { return getScopedName ( attrName , requestScopeParam ) ; } ScopedRequest scopedRequest = unwrapRequest ( request ) ; r... | If the request is a ScopedRequest this returns an attribute name scoped to that request s scope - ID ; otherwise it returns the given attribute name . |
9,715 | public static final String getRelativeURI ( HttpServletRequest request , String uri ) { return getRelativeURI ( request . getContextPath ( ) , uri ) ; } | Get a URI relative to the webapp root . |
9,716 | public static final String getRelativeURI ( String contextPath , String uri ) { String requestUrl = uri ; int overlap = requestUrl . indexOf ( contextPath + '/' ) ; assert overlap != - 1 : "contextPath: " + contextPath + ", uri: " + uri ; return requestUrl . substring ( overlap + contextPath . length ( ) ) ; } | Get a URI relative to a given webapp root . |
9,717 | public static String normalizeURI ( String uri ) { if ( uri . indexOf ( "./" ) != - 1 ) { try { uri = new URI ( uri ) . normalize ( ) . toString ( ) ; } catch ( URISyntaxException e ) { logger . error ( "Could not parse relative URI " + uri ) ; } } return uri ; } | Resolve . and .. in a URI . |
9,718 | public void updateProperties ( Collection newProps ) { _properties = new ArrayList ( ) ; if ( newProps != null ) { _properties . addAll ( newProps ) ; } } | Sets the collection of properties for a form bean to a new collection . |
9,719 | protected final Element findChildElement ( XmlModelWriter xw , Element parent , String childName , String keyAttributeName , String keyAttributeValue , boolean createIfNotPresent , String [ ] createOrder ) { NodeList childNodes = parent . getChildNodes ( ) ; for ( int i = 0 ; i < childNodes . getLength ( ) ; ++ i ) { N... | Find a child element by name and optionally add it if it isn t present . |
9,720 | public String getModulePath ( ) { ClassLevelCache cache = ClassLevelCache . getCache ( getClass ( ) ) ; String modulePath = ( String ) cache . getCacheObject ( CACHED_INFO_KEY ) ; if ( modulePath == null ) { modulePath = "/-" ; String className = getClass ( ) . getName ( ) ; int lastDot = className . lastIndexOf ( '.' ... | Get the Struts module path for actions in this shared flow . |
9,721 | void savePreviousActionInfo ( ActionForm form , HttpServletRequest request , ActionMapping mapping , ServletContext servletContext ) { PageFlowController currentJpf = PageFlowUtils . getCurrentPageFlow ( request , getServletContext ( ) ) ; if ( currentJpf != null ) currentJpf . savePreviousActionInfo ( form , request ,... | Store information about the most recent action invocation . This is a framework - invoked method that should not normally be called directly |
9,722 | void reinitializeIfNecessary ( HttpServletRequest request , HttpServletResponse response , ServletContext servletContext ) { if ( _servletContext == null ) { reinitialize ( request , response , servletContext ) ; } } | Internal method to reinitialize only if necessary . The test is whether the ServletContext reference has been lost . |
9,723 | protected boolean fieldIsUninitialized ( Field field ) { try { return field != null && field . get ( this ) == null ; } catch ( IllegalAccessException e ) { _log . error ( "Error initializing field " + field . getName ( ) + " in " + getDisplayName ( ) , e ) ; return false ; } } | Tell whether the given Field is uninitialized . |
9,724 | protected void initializeField ( Field field , Object instance ) { if ( instance != null ) { if ( _log . isTraceEnabled ( ) ) { _log . trace ( "Initializing field " + field . getName ( ) + " in " + getDisplayName ( ) + " with " + instance ) ; } try { field . set ( this , instance ) ; } catch ( IllegalArgumentException ... | Initialize the given field with an instance . Mainly useful for the error handling . |
9,725 | public Object mapToResultType ( ControlBeanContext context , Method m , ResultSet resultSet , Calendar cal ) { return resultSet ; } | Maps a ResultSet to a ResultSet . The default implementation is a NOOP . |
9,726 | public String extractModel ( XLog log ) { XAttribute attribute = log . getAttributes ( ) . get ( KEY_MODEL ) ; if ( attribute == null ) { return null ; } else { return ( ( XAttributeLiteral ) attribute ) . getValue ( ) ; } } | Extracts the lifecycle model identifier from a given log . |
9,727 | public void assignModel ( XLog log , String model ) { if ( model != null && model . trim ( ) . length ( ) > 0 ) { XAttributeLiteral modelAttr = ( XAttributeLiteral ) ATTR_MODEL . clone ( ) ; modelAttr . setValue ( model . trim ( ) ) ; log . getAttributes ( ) . put ( KEY_MODEL , modelAttr ) ; } } | Assigns a value for the lifecycle model identifier to a given log . |
9,728 | public boolean usesStandardModel ( XLog log ) { String model = extractModel ( log ) ; if ( model == null ) { return false ; } else if ( model . trim ( ) . equals ( VALUE_MODEL_STANDARD ) ) { return true ; } else { return false ; } } | Checks whether a given log uses the standard model for lifecycle transitions . |
9,729 | public String extractTransition ( XEvent event ) { XAttribute attribute = event . getAttributes ( ) . get ( KEY_TRANSITION ) ; if ( attribute == null ) { return null ; } else { return ( ( XAttributeLiteral ) attribute ) . getValue ( ) ; } } | Extracts the lifecycle transition string from a given event . |
9,730 | public StandardModel extractStandardTransition ( XEvent event ) { String transition = extractTransition ( event ) ; if ( transition != null ) { return StandardModel . decode ( transition ) ; } else { return null ; } } | Extracts the standard lifecycle transition object from a given event . |
9,731 | public void assignTransition ( XEvent event , String transition ) { if ( transition != null && transition . trim ( ) . length ( ) > 0 ) { XAttributeLiteral transAttr = ( XAttributeLiteral ) ATTR_TRANSITION . clone ( ) ; transAttr . setValue ( transition . trim ( ) ) ; event . getAttributes ( ) . put ( KEY_TRANSITION , ... | Assigns a lifecycle transition string to the given event . |
9,732 | protected int getNextId ( ServletRequest req ) { Integer i = ( Integer ) RequestUtils . getOuterAttribute ( ( HttpServletRequest ) req , NETUI_UNIQUE_CNT ) ; if ( i == null ) { i = new Integer ( 0 ) ; } int ret = i . intValue ( ) ; RequestUtils . setOuterAttribute ( ( HttpServletRequest ) req , NETUI_UNIQUE_CNT , new I... | This method will generate the next unique int within the HTML tag . |
9,733 | protected Form getNearestForm ( ) { Tag parentTag = getParent ( ) ; while ( parentTag != null ) { if ( parentTag instanceof Form ) return ( Form ) parentTag ; parentTag = parentTag . getParent ( ) ; } return null ; } | Returns the closest parent form tag or null if there is none . |
9,734 | public synchronized void setProperty ( PropertyKey key , Object value ) { if ( ! isValidKey ( key ) ) throw new IllegalArgumentException ( "Key " + key + " is not valid for " + getMapClass ( ) ) ; Class propType = key . getPropertyType ( ) ; if ( value == null ) { if ( propType . isPrimitive ( ) || propType . isAnnotat... | Sets the property specifed by key within this map . |
9,735 | public static NameService instance ( HttpSession session ) { if ( session == null ) throw new IllegalArgumentException ( "Session must not be null" ) ; Object sessionMutex = ServletUtils . getSessionMutex ( session , NAME_SERVICE_MUTEX_ATTRIBUTE ) ; synchronized ( sessionMutex ) { NameService nameService = ( NameServic... | This will return the session specific instance of a NameService . There will only be a single NameService per session . |
9,736 | private synchronized void readObject ( ObjectInputStream in ) throws IOException , ClassNotFoundException { in . defaultReadObject ( ) ; if ( _nameMap == null ) { _nameMap = new HashMap ( ) ; } } | Deserialize an instance of this class . |
9,737 | public synchronized void nameObject ( String namePrefix , INameable object ) { String name = namePrefix + Integer . toString ( _nextValue ++ ) ; object . setObjectName ( name ) ; } | This method will create a unique name for an INameable object . The name will be unque within the session . This will throw an IllegalStateException if INameable . setObjectName has previously been called on object . |
9,738 | private void reclaimSpace ( ) { if ( _nameMap == null ) return ; if ( _nameMap . size ( ) > 0 && _nameMap . size ( ) % _reclaimPoint == 0 ) { synchronized ( _nameMap ) { Set s = _nameMap . entrySet ( ) ; Iterator it = s . iterator ( ) ; while ( it . hasNext ( ) ) { Map . Entry e = ( Map . Entry ) it . next ( ) ; Tracki... | This mehtod will check the name map for entries where the WeakReference object has been reclaimed . When they are found it will reclaim the entry in the map . |
9,739 | private void fireNamingObjectEvent ( TrackingObject to ) { Object [ ] copy ; if ( _listeners == null ) return ; synchronized ( _listeners ) { copy = _listeners . toArray ( ) ; } INameable o = ( INameable ) to . getWeakINameable ( ) . get ( ) ; for ( int i = 0 ; i < copy . length ; i ++ ) { ( ( NamingObjectListener ) co... | This method will fire the NamingObject event . This event is triggered when we have added an element to be tracked . |
9,740 | private static synchronized File getSwapDir ( ) throws IOException { if ( SWAP_DIR == null ) { File swapDir = File . createTempFile ( SWAP_DIR_PREFIX , SWAP_DIR_SUFFIX , TMP_DIR ) ; swapDir . delete ( ) ; File lockFile = new File ( TMP_DIR , swapDir . getName ( ) + LOCK_FILE_SUFFIX ) ; lockFile . createNewFile ( ) ; lo... | Retrieves a file handle on the swap directory of this session . |
9,741 | private static synchronized void cleanup ( ) { int cleanedDirs = 0 ; int cleanedFiles = 0 ; File [ ] swapDirs = TMP_DIR . listFiles ( new FileFilter ( ) { public boolean accept ( File pathname ) { return pathname . getName ( ) . endsWith ( SWAP_DIR_SUFFIX ) ; } } ) ; for ( File swapDir : swapDirs ) { File lockFile = ne... | Cleans up stale swap files and directories left over from previous sessions . Only swap directories for which no lock file exists will be removed . |
9,742 | private static synchronized int deleteRecursively ( File directory ) { int deleted = 0 ; if ( directory . isDirectory ( ) ) { File [ ] contents = directory . listFiles ( ) ; for ( File file : contents ) { deleted += deleteRecursively ( file ) ; } } else { deleted ++ ; } directory . delete ( ) ; return deleted ; } | Deletes the given directory recursively i . e . bottom - up . |
9,743 | public Locale getLocale ( ) throws JspException { Locale loc = null ; if ( _language != null || _country != null ) { if ( _language == null ) { String s = Bundle . getString ( "Tags_LocaleRequiresLanguage" , new Object [ ] { _country } ) ; registerTagError ( s , null ) ; return super . getUserLocale ( ) ; } if ( _count... | Returns the locale based on the country and language . |
9,744 | public synchronized boolean replace ( XEvent event , int index ) throws IOException { if ( index < 0 || index >= size ) { throw new IndexOutOfBoundsException ( ) ; } navigateToIndex ( index ) ; storage . seek ( position ) ; long atePosition = position ; int fwd = storage . readInt ( ) ; storage . skipBytes ( 8 ) ; int ... | Replaces an event at the given position . |
9,745 | public synchronized XEvent get ( int eventIndex ) throws IOException , IndexOutOfBoundsException { if ( eventIndex < 0 || eventIndex >= size ) { throw new IndexOutOfBoundsException ( ) ; } navigateToIndex ( eventIndex ) ; return read ( ) ; } | Retrieves the event recorded at the specified position |
9,746 | protected synchronized void navigateToIndex ( int reqIndex ) throws IOException { if ( reqIndex != index ) { if ( reqIndex < 0 || reqIndex >= size ) { throw new IndexOutOfBoundsException ( ) ; } if ( reqIndex > index ) { skipForward ( reqIndex - index ) ; } else { int backSkips = index - reqIndex ; if ( backSkips < ( i... | Repositions the low - level layer to read from the specified index . |
9,747 | protected synchronized void skipForward ( int eventsToSkip ) throws IOException { int offset = 0 ; for ( int i = 0 ; i < eventsToSkip ; i ++ ) { storage . seek ( position ) ; offset = storage . readInt ( ) ; position += offset ; index ++ ; } } | Repositions the position of the data access layer to skip the specified number of records towards the end of the file . |
9,748 | protected synchronized XEvent read ( ) throws IOException { storage . seek ( position ) ; long nextPosition = position + storage . readInt ( ) ; storage . skipBytes ( 4 ) ; int eventSize = storage . readInt ( ) ; byte [ ] eventData = new byte [ eventSize ] ; storage . readFully ( eventData ) ; DataInputStream dis = new... | Reads an event from the current position of the data access layer . Calling this method implies the advancement of the data access layer so that the next call will yield the subsequent event . |
9,749 | public int doEndTag ( ) throws JspException { HttpServletRequest req = ( HttpServletRequest ) pageContext . getRequest ( ) ; if ( ! InternalUtils . isMultipartHandlingEnabled ( req ) ) { String s = Bundle . getString ( "Tags_FileMultiOff" , null ) ; registerTagError ( s , null ) ; return EVAL_PAGE ; } ByRef ref = new B... | Render the FileUpload . |
9,750 | protected String buildLiveFirstLink ( ) { InternalStringBuilder builder = new InternalStringBuilder ( ) ; AbstractRenderAppender appender = new StringBuilderRenderAppender ( builder ) ; buildAnchor ( appender , _gridModel . getUrlBuilder ( ) . getQueryParamsForFirstPage ( ) , IDataGridMessageKeys . PAGER_MSG_FIRST ) ; ... | Build an HTML anchor that contains URL state for navigating to the first page of a data set . |
9,751 | protected String buildLiveLastLink ( ) { InternalStringBuilder builder = new InternalStringBuilder ( ) ; AbstractRenderAppender appender = new StringBuilderRenderAppender ( builder ) ; buildAnchor ( appender , _gridModel . getUrlBuilder ( ) . getQueryParamsForLastPage ( ) , IDataGridMessageKeys . PAGER_MSG_LAST ) ; ret... | Build an HTML anchor that contains URL state for navigating to the last page of a data set . |
9,752 | protected final void buildAnchor ( AbstractRenderAppender appender , Map queryParams , String labelKey ) { assert appender != null ; assert queryParams != null ; assert labelKey != null && labelKey . length ( ) > 0 ; _anchorState . href = buildPageUri ( queryParams ) ; _anchorTag . doStartTag ( appender , _anchorState ... | Build the anchor |
9,753 | private static void initPrefixHandlers ( ) { PrefixHandlerConfig [ ] prefixHandlers = ConfigUtil . getConfig ( ) . getPrefixHandlers ( ) ; if ( prefixHandlers == null ) { return ; } for ( int i = 0 ; i < prefixHandlers . length ; i ++ ) { try { Class prefixClass = Class . forName ( prefixHandlers [ i ] . getHandlerClas... | This method will initialize all of the PrefixHandlers registered in the netui config . The prefix handlers are registered with ProcessPopulate and are typically implemented as public inner classes in the tags that require prefix handlers . |
9,754 | protected Object evaluateDefaultValue ( ) throws JspException { Object val = _defaultValue ; List defaults = null ; if ( val instanceof String ) { defaults = new ArrayList ( ) ; defaults . add ( val ) ; } else { Iterator optionsIterator = null ; optionsIterator = IteratorFactory . createIterator ( val ) ; if ( optionsI... | Evaluate the defaultValues |
9,755 | public int doStartTag ( ) throws JspException { Object val = evaluateDataSource ( ) ; _defaultSelections = ( List ) evaluateDefaultValue ( ) ; if ( hasErrors ( ) ) return SKIP_BODY ; buildMatch ( val ) ; if ( hasErrors ( ) ) return SKIP_BODY ; _formatters = new ArrayList ( ) ; _optionList = new ArrayList ( ) ; _dynamic... | Render the beginning of this select . |
9,756 | private void buildMatch ( Object val ) { if ( val != null ) { if ( val instanceof String ) { _match = new String [ ] { ( String ) val } ; } else if ( val instanceof String [ ] ) { String [ ] s = ( String [ ] ) val ; int cnt = 0 ; for ( int i = 0 ; i < s . length ; i ++ ) { if ( s [ i ] != null ) cnt ++ ; } if ( cnt == ... | This method builds the list of selected items so that they can be marked as selected . |
9,757 | private void addDefaultsIfNeeded ( ServletRequest req ) throws JspException { if ( _defaultSelections != null ) { Iterator iterator = _defaultSelections . iterator ( ) ; while ( iterator . hasNext ( ) ) { Object selection = iterator . next ( ) ; if ( ! _optionList . contains ( selection ) ) { addOption ( req , selectio... | add the default values specified in the tag if they are needed . |
9,758 | private void addDatasourceIfNeeded ( ServletRequest req ) throws JspException { if ( _match == null ) return ; for ( int i = 0 ; i < _match . length ; i ++ ) { if ( ! _optionList . contains ( _match [ i ] ) ) { if ( ! _match [ i ] . equals ( NULL_VALUE ) ) addOption ( req , _match [ i ] , _match [ i ] ) ; } } } | add dthe datasource values if needed . |
9,759 | public void register ( XEvent event ) { Date date = XTimeExtension . instance ( ) . extractTimestamp ( event ) ; if ( date != null ) { register ( date ) ; } } | Registers the given event i . e . if it has a timestamp the timestamp boundaries will be potentially adjusted to accomodate for inclusion of this event . |
9,760 | public void register ( Date date ) { if ( date != null ) { if ( first == null ) { first = date ; last = date ; } else if ( date . before ( first ) ) { first = date ; } else if ( date . after ( last ) ) { last = date ; } } } | Registers the given date . The timestamp boundaries will be potentially adjusted to accomodate for inclusion of this date . |
9,761 | public int doEndTag ( ) throws JspException { ServletRequest req = pageContext . getRequest ( ) ; if ( _password ) { _state . type = INPUT_PASSWORD ; } else { _state . type = INPUT_TEXT ; } ByRef ref = new ByRef ( ) ; nameHtmlControl ( _state , ref ) ; _state . disabled = isDisabled ( ) ; Object textObject = evaluateDa... | Render the TextBox . |
9,762 | public static void dumpRequest ( ServletRequest request , PrintStream output ) { if ( output == null ) { output = System . err ; } output . println ( "*** ServletRequest " + request ) ; if ( request instanceof HttpServletRequest ) { output . println ( " uri = " + ( ( HttpServletRequest ) request ) . getRequestUR... | Print parameters and attributes in the given request . |
9,763 | public static void dumpServletContext ( ServletContext context , PrintStream output ) { if ( output == null ) { output = System . err ; } output . println ( "*** ServletContext " + context ) ; for ( Enumeration e = context . getAttributeNames ( ) ; e . hasMoreElements ( ) ; ) { String name = ( String ) e . nextElement ... | Print attributes in the given ServletContext . |
9,764 | public static void preventCache ( ServletResponse response ) { if ( response instanceof HttpServletResponse ) { HttpServletResponse httpResponse = ( HttpServletResponse ) response ; httpResponse . setHeader ( "Pragma" , "No-cache" ) ; httpResponse . setHeader ( "Cache-Control" , "no-cache,no-store,max-age=0" ) ; httpRe... | Set response headers to prevent caching of the response by the browser . |
9,765 | public static String getBaseName ( String uri ) { int lastSlash = uri . lastIndexOf ( '/' ) ; assert lastSlash != - 1 : uri ; assert lastSlash < uri . length ( ) - 1 : "URI must not end with a slash: " + uri ; return uri . substring ( lastSlash + 1 ) ; } | Get the base filename of the given URI . |
9,766 | public static String getDirName ( String uri ) { int lastSlash = uri . lastIndexOf ( '/' ) ; assert lastSlash != - 1 : uri ; assert uri . length ( ) > 1 : uri ; assert lastSlash < uri . length ( ) - 1 : "URI must not end with a slash: " + uri ; return uri . substring ( 0 , lastSlash ) ; } | Get the directory path of the given URI . |
9,767 | private int parseContentLength ( int maxPostDataSize , String length ) { if ( length != null ) { try { int size = Integer . parseInt ( length ) ; if ( size > maxPostDataSize ) return - 1 ; else return size ; } catch ( NumberFormatException e ) { return - 1 ; } } else { return - 2 ; } } | If there is a content length header . Check the reported length making sure it isn t over the max post data size . |
9,768 | public static String getNamePrefix ( ServletContext servletContext , ServletRequest request , String name ) { ArrayList rewriters = getRewriters ( request ) ; InternalStringBuilder prefix = new InternalStringBuilder ( ) ; if ( rewriters != null ) { for ( Iterator i = rewriters . iterator ( ) ; i . hasNext ( ) ; ) { URL... | Get the prefix to use when rewriting a query parameter name . Loops through the list of registered URLRewriters to build up a the prefix . |
9,769 | public static void rewriteURL ( ServletContext servletContext , ServletRequest request , ServletResponse response , MutableURI url , URLType type , boolean needsToBeSecure ) { ArrayList rewriters = getRewriters ( request ) ; if ( rewriters != null ) { for ( Iterator i = rewriters . iterator ( ) ; i . hasNext ( ) ; ) { ... | Rewrite the given URL looping through the list of registered URLRewriters . |
9,770 | public static void dumpURLRewriters ( ServletRequest request , PrintStream output ) { ArrayList rewriters = getRewriters ( request ) ; if ( output == null ) output = System . err ; output . println ( "*** List of URLRewriter objects: " + rewriters ) ; if ( rewriters != null ) { int count = 0 ; for ( Iterator i = rewrit... | Print out information about the chain of URLRewriters in this request . |
9,771 | public String getMethodField ( ) { StringBuffer sb = new StringBuffer ( ) ; sb . append ( "_" ) ; sb . append ( _eventSet . getShortName ( ) ) ; sb . append ( "_" ) ; sb . append ( getName ( ) ) ; int methodIndex = getIndex ( ) ; if ( methodIndex != - 1 ) sb . append ( methodIndex ) ; sb . append ( "Event" ) ; return s... | Returns the name of the static field that holds the name of this method . |
9,772 | protected static Interceptor addInterceptor ( InterceptorConfig config , Class baseClassOrInterface , List interceptors ) { Interceptor interceptor = createInterceptor ( config , baseClassOrInterface ) ; if ( interceptor != null ) interceptors . add ( interceptor ) ; return interceptor ; } | Instantiates an interceptor based on the class name in the given InterceptorConfig and adds it to the given collection of interceptors . |
9,773 | protected static Interceptor createInterceptor ( InterceptorConfig config , Class baseClassOrInterface ) { assert Interceptor . class . isAssignableFrom ( baseClassOrInterface ) : baseClassOrInterface . getName ( ) + " cannot be assigned to " + Interceptor . class . getName ( ) ; ClassLoader cl = DiscoveryUtils . getCl... | Instantiates an interceptor using the class name in the given InterceptorConfig . |
9,774 | public Object continueChain ( ) throws InterceptorException { if ( ! _chain . isEmpty ( ) ) { return invoke ( ( Interceptor ) _chain . removeFirst ( ) ) ; } else { return null ; } } | Execute the next interceptor in the chain of interceptors . |
9,775 | public static boolean isAction ( HttpServletRequest request , String action ) { FlowController flowController = PageFlowUtils . getCurrentPageFlow ( request ) ; if ( flowController != null ) { if ( action . endsWith ( PageFlowConstants . ACTION_EXTENSION ) ) { action = action . substring ( 0 , action . length ( ) - Pag... | Determine whether a given URI is an Action . |
9,776 | protected void renderGeneral ( HashMap map , AbstractRenderAppender sb , boolean doubleQuote ) { if ( map == null ) return ; Iterator iterator = map . keySet ( ) . iterator ( ) ; for ( ; iterator . hasNext ( ) ; ) { String key = ( String ) iterator . next ( ) ; if ( key == null ) continue ; String value = ( String ) ma... | This method will render all of the general attributes . |
9,777 | static String getDefaultControlBinding ( Class controlIntf ) { controlIntf = getMostDerivedInterface ( controlIntf ) ; ControlInterface intfAnnot = ( ControlInterface ) controlIntf . getAnnotation ( ControlInterface . class ) ; String implBinding = intfAnnot . defaultBinding ( ) ; implBinding = resolveDefaultBinding ( ... | Returns the default binding based entirely upon annotations or naming conventions . |
9,778 | static Class getMostDerivedInterface ( Class controlIntf ) { while ( controlIntf . isAnnotationPresent ( ControlExtension . class ) ) { Class [ ] intfs = controlIntf . getInterfaces ( ) ; boolean found = false ; for ( int i = 0 ; i < intfs . length ; i ++ ) { if ( intfs [ i ] . isAnnotationPresent ( ControlExtension . ... | Computes the most derived ControlInterface for the specified ControlExtension . |
9,779 | protected void update ( long readBytes ) throws IOException { if ( progressListener . isAborted ( ) ) { throw new IOException ( "Reading Cancelled by ProgressListener" ) ; } this . bytesRead += readBytes ; int step = ( int ) ( bytesRead / stepSize ) ; if ( step > lastStep ) { lastStep = step ; progressListener . update... | This method is called by the actual input stream method to provide feedback about the number of read bytes . |
9,780 | protected synchronized void addResourceContext ( ResourceContext resourceContext , ControlBean bean ) { if ( ! resourceContext . hasResources ( ) ) _resourceContexts . push ( resourceContext ) ; } | Adds a new managed ResourceContext to the ControlContainerContext . This method is used to register a resource context that has just acquired resources |
9,781 | protected synchronized void removeResourceContext ( ResourceContext resourceContext , ControlBean bean ) { if ( ! _releasingAll && resourceContext . hasResources ( ) ) _resourceContexts . remove ( resourceContext ) ; } | Removes a managed ResourceContext from the ControlContainerContext . This method is used to unregister a resource context that has already acquired resources |
9,782 | protected synchronized void releaseResources ( ) { _releasingAll = true ; while ( ! _resourceContexts . empty ( ) ) { ResourceContext resourceContext = _resourceContexts . pop ( ) ; resourceContext . release ( ) ; } _releasingAll = false ; } | Releases all ResourceContexts associated with the current ControlContainerContext . This method is called by the associated container whenever all managed ResourceContexts that have acquired resources should release them . |
9,783 | public Object dispatchEvent ( ControlHandle handle , EventRef event , Object [ ] args ) throws IllegalArgumentException , IllegalAccessException , InvocationTargetException { ControlBean bean = getBean ( handle . getControlID ( ) ) ; if ( bean == null ) throw new IllegalArgumentException ( "Invalid bean ID: " + handle ... | Dispatch an operation or an event to a bean within this container bean context . |
9,784 | public ControlHandle getControlHandle ( org . apache . beehive . controls . api . bean . ControlBean bean ) { return null ; } | Returns a ControlHandle to the component containing the control . This handle can be used to dispatch events and operations to a control instance . This method will return null if the containing component does not support direct dispatch . |
9,785 | public void setTemplate ( String template ) { if ( template == null || template . length ( ) == 0 ) { throw new IllegalStateException ( "Template cannot be null or empty." ) ; } if ( template . equals ( _template ) ) { return ; } _template = template ; _isParsed = false ; _parsedTemplate = null ; } | Reset the String form of the template . |
9,786 | public boolean verify ( Collection knownTokens , Collection requiredTokens ) { boolean valid = true ; if ( knownTokens != null ) { for ( java . util . Iterator ii = knownTokens . iterator ( ) ; ii . hasNext ( ) ; ) { String token = ( String ) ii . next ( ) ; if ( token != null && token . length ( ) > 2 ) { token = toke... | Verification will ensure the URL template conforms to a valid format for known tokens and contains the required tokens . It will also parse the tokens and literal data into a list to improve the replacement performance when constructing the final URL string . |
9,787 | protected void appendToResult ( InternalStringBuilder result , String value ) { if ( value == null || value . length ( ) == 0 ) { return ; } if ( result . length ( ) > 0 && result . charAt ( result . length ( ) - 1 ) == '/' && value . charAt ( 0 ) == '/' ) { result . deleteCharAt ( result . length ( ) - 1 ) ; } result ... | of the URL |
9,788 | public static XID parse ( String idString ) { UUID uuid = UUID . fromString ( idString ) ; return new XID ( uuid ) ; } | Parses an XID object from its text representation . |
9,789 | public static XID read ( DataInputStream dis ) throws IOException { long msb = dis . readLong ( ) ; long lsb = dis . readLong ( ) ; return new XID ( msb , lsb ) ; } | Reads a binary - serialized XID from a data input stream . |
9,790 | public static XID read ( DataInput in ) throws IOException { long msb = in . readLong ( ) ; long lsb = in . readLong ( ) ; return new XID ( msb , lsb ) ; } | Reads a binary - serialized XID from a data input . |
9,791 | public static String getIRIFromNodeID ( String nodeID ) { if ( nodeID . startsWith ( PREFIX_SHARED_NODE ) ) { return nodeID ; } return PREFIX_SHARED_NODE + nodeID . replace ( NODE_ID_PREFIX , "" ) ; } | Returns an absolute IRI from a nodeID attribute . |
9,792 | public static NodeID getNodeID ( String id ) { String nonBlankId = id == null || id . isEmpty ( ) ? nextAnonymousIRI ( ) : id ; return new NodeID ( nonBlankId ) ; } | Gets a NodeID with a specific identifier string |
9,793 | public static URIContext getInstance ( ) { URIContext uriContext = MutableURI . getDefaultContext ( ) ; UrlConfig urlConfig = ConfigUtil . getConfig ( ) . getUrlConfig ( ) ; if ( urlConfig != null ) { uriContext . setUseAmpEntity ( urlConfig . isHtmlAmpEntity ( ) ) ; } return uriContext ; } | Get a URIContext . The context has data used to write a MutableURI as a string . For example it will indicate that the URI should be written using the " ; & ; amp ; " ; entity rather than the character & ; . This returns the default context but also checks for any overriding setting in the NetUI config . |
9,794 | public static URIContext getInstance ( boolean forXML ) { URIContext uriContext = null ; if ( forXML ) { uriContext = new URIContext ( ) ; uriContext . setUseAmpEntity ( true ) ; } else { uriContext = getInstance ( ) ; } return uriContext ; } | Get a URIContext . If it s for an XML document type the context will indicate that the URI should be written using the " ; & ; amp ; " ; entity rather than the character & ; . If it s not for an XML doc type then use the default context but check for any overriding setting in the NetUI config . |
9,795 | public static void reportCollectedErrors ( PageContext pc , JspTag tag ) { IErrorReporter er = getErrorReporter ( tag ) ; if ( er == null ) return ; assert ( pc != null ) ; ArrayList errors = er . returnErrors ( ) ; if ( errors == null || errors . size ( ) == 0 ) return ; assert ( errors . size ( ) > 0 ) ; String s ; s... | This method get the current errors and write the formated output |
9,796 | public static void initJavaControls ( HttpServletRequest request , HttpServletResponse response , ServletContext servletContext , PageFlowManagedObject controlClient ) throws ControlFieldInitializationException { Class controlClientClass = controlClient . getClass ( ) ; Map controlFields = getAccessibleControlFieldAnno... | Initialize all null member variables that are Java Controls . |
9,797 | public static void uninitJavaControls ( ServletContext servletContext , PageFlowManagedObject controlClient ) { Map controlFields = getAccessibleControlFieldAnnotations ( controlClient . getClass ( ) , servletContext ) ; for ( Iterator i = controlFields . keySet ( ) . iterator ( ) ; i . hasNext ( ) ; ) { Field controlF... | Clean up all member variables that are Java Controls . |
9,798 | private static void destroyControl ( Object controlInstance ) { assert controlInstance instanceof ControlBean : controlInstance . getClass ( ) . getName ( ) ; BeanContext beanContext = ( ( ControlBean ) controlInstance ) . getBeanContext ( ) ; if ( beanContext != null ) { if ( LOG . isTraceEnabled ( ) ) LOG . trace ( "... | Destroy a Beehive Control . |
9,799 | public String getFlowControllerURI ( ) { FlowController flowController = getFlowController ( ) ; return flowController != null ? flowController . getDisplayName ( ) : null ; } | Get the name of the related FlowController . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.