idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
9,100
public void setOnBlur ( String onblur ) { _anchorState . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , HtmlConstants . ONBLUR , onblur ) ; }
Sets the onBlur JavaScript event for the HTML anchor .
9,101
public void setOnFocus ( String onfocus ) { _anchorState . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , HtmlConstants . ONFOCUS , onfocus ) ; }
Sets the onFocus JavaScript event for the HTML anchor .
9,102
public int doStartTag ( ) throws JspException { ServletRequest req = pageContext . getRequest ( ) ; HashMap atts = ( HashMap ) req . getAttribute ( TEMPLATE_ATTRIBUTES ) ; try { if ( atts != null ) { String val = ( String ) atts . get ( _name ) ; if ( val != null ) { Writer out = pageContext . getOut ( ) ; out . write ( val ) ; } else { Writer out = pageContext . getOut ( ) ; if ( _defaultValue != null ) out . write ( _defaultValue ) ; else out . write ( "" ) ; } } else { Writer out = pageContext . getOut ( ) ; if ( _defaultValue != null ) out . write ( _defaultValue ) ; else out . write ( "" ) ; } } catch ( IOException e ) { localRelease ( ) ; JspException jspException = new JspException ( "Caught IO Exception:" + e . getMessage ( ) , e ) ; if ( jspException . getCause ( ) == null ) { jspException . initCause ( e ) ; } throw jspException ; } localRelease ( ) ; return EVAL_PAGE ; }
Renders the content of the attribute .
9,103
private ArrayList < AptContextField > initContexts ( ) { ArrayList < AptContextField > contexts = new ArrayList < AptContextField > ( ) ; if ( _implDecl == null || _implDecl . getFields ( ) == null ) return contexts ; Collection < FieldDeclaration > declaredFields = _implDecl . getFields ( ) ; for ( FieldDeclaration fieldDecl : declaredFields ) { if ( fieldDecl . getAnnotation ( org . apache . beehive . controls . api . context . Context . class ) != null ) contexts . add ( new AptContextField ( this , fieldDecl , _ap ) ) ; } return contexts ; }
Initializes the list of ContextField declared directly by this ControlImpl
9,104
private ArrayList < AptControlField > initControls ( ) { ArrayList < AptControlField > fields = new ArrayList < AptControlField > ( ) ; if ( _implDecl == null || _implDecl . getFields ( ) == null ) return fields ; Collection < FieldDeclaration > declaredFields = _implDecl . getFields ( ) ; for ( FieldDeclaration fieldDecl : declaredFields ) { if ( fieldDecl . getAnnotation ( org . apache . beehive . controls . api . bean . Control . class ) != null ) fields . add ( new AptControlField ( this , fieldDecl , _ap ) ) ; } return fields ; }
Initializes the list of ControlFields for this ControlImpl
9,105
protected ArrayList < AptClientField > initClients ( ) { ArrayList < AptClientField > clients = new ArrayList < AptClientField > ( ) ; if ( _implDecl == null || _implDecl . getFields ( ) == null ) return clients ; Collection < FieldDeclaration > declaredFields = _implDecl . getFields ( ) ; for ( FieldDeclaration fieldDecl : declaredFields ) { if ( fieldDecl . getAnnotation ( Client . class ) != null ) clients . add ( new AptClientField ( this , fieldDecl ) ) ; } return clients ; }
Initializes the list of ClientFields declared directly by this ControlImpl
9,106
public List < GeneratorOutput > getCheckOutput ( Filer filer ) throws IOException { HashMap < String , Object > map = new HashMap < String , Object > ( ) ; map . put ( "impl" , this ) ; map . put ( "init" , _init ) ; Writer writer = new IndentingWriter ( filer . createSourceFile ( _init . getClassName ( ) ) ) ; GeneratorOutput genOut = new GeneratorOutput ( writer , "org/apache/beehive/controls/runtime/generator/ImplInitializer.vm" , map ) ; ArrayList < GeneratorOutput > genList = new ArrayList < GeneratorOutput > ( 1 ) ; genList . add ( genOut ) ; return genList ; }
Returns the information necessary to generate a ImplInitializer from this ControlImplementation .
9,107
public AptControlInterface getControlInterface ( ) { if ( _implDecl == null || _implDecl . getSuperinterfaces ( ) == null ) return null ; Collection < InterfaceType > superInterfaces = _implDecl . getSuperinterfaces ( ) ; for ( InterfaceType intfType : superInterfaces ) { InterfaceDeclaration intfDecl = intfType . getDeclaration ( ) ; if ( intfDecl != null && intfDecl . getAnnotation ( org . apache . beehive . controls . api . bean . ControlInterface . class ) != null ) return new AptControlInterface ( intfDecl , _ap ) ; } return null ; }
Returns the ControlInterface implemented by this ControlImpl .
9,108
protected boolean isSerializable ( ) { for ( InterfaceType superIntf : _implDecl . getSuperinterfaces ( ) ) { if ( superIntf . toString ( ) . equals ( "java.io.Serializable" ) ) { return true ; } } return _superClass != null && _superClass . isSerializable ( ) ; }
Does this control impl on one of it superclasses implement java . io . Serializable?
9,109
private void waitForThread ( ) { if ( ( this . thread != null ) && this . thread . isAlive ( ) ) { try { this . thread . join ( ) ; } catch ( final InterruptedException e ) { e . printStackTrace ( ) ; } } }
As the result of Updater output depends on the thread s completion it is necessary to wait for the thread to finish before allowing anyone to check the result .
9,110
private boolean versionCheck ( String title ) { if ( this . type != UpdateType . NO_VERSION_CHECK ) { final String version = caller . getPluginVersion ( ) ; final String remoteVersion = title ; if ( this . hasTag ( version ) || version . contains ( remoteVersion ) ) { this . result = Updater . UpdateResult . NO_UPDATE ; return false ; } } return true ; }
Check to see if the program should continue by evaluation whether the plugin is already updated or shouldn t be updated
9,111
private boolean hasTag ( String version ) { for ( final String string : Updater . NO_UPDATE_TAG ) { if ( version . contains ( string ) ) { return true ; } } return false ; }
Evaluate whether the version number is marked showing that it should not be updated by this program
9,112
private void removeRoutingConstraintsOnAttribute ( String attribute , boolean notifyListeners ) { for ( String activity : activities ) { removeRoutingConstraintsOnAttribute ( activity , attribute , notifyListeners ) ; } }
Removes all routing constraints that relate to the given attribute
9,113
public SqlStatement parse ( String sql ) { if ( _cachedSqlStatements . containsKey ( sql ) ) { return _cachedSqlStatements . get ( sql ) ; } SqlGrammar _parser = new SqlGrammar ( new StringReader ( sql ) ) ; SqlStatement parsed = null ; try { parsed = _parser . parse ( ) ; } catch ( ParseException e ) { throw new ControlException ( "Error parsing SQL statment." + e . getMessage ( ) , e ) ; } catch ( TokenMgrError tme ) { throw new ControlException ( "Error parsing SQL statment. " + tme . getMessage ( ) , tme ) ; } if ( parsed . isCacheable ( ) ) { _cachedSqlStatements . put ( sql , parsed ) ; } return parsed ; }
Parse the sql and return an SqlStatement .
9,114
public RowSet mapToResultType ( ControlBeanContext context , Method m , ResultSet resultSet , Calendar cal ) { final SQL methodSQL = ( SQL ) context . getMethodPropertySet ( m , SQL . class ) ; final int maxrows = methodSQL . maxRows ( ) ; try { CachedRowSetImpl rows = new CachedRowSetImpl ( ) ; if ( maxrows > 0 ) { rows . setMaxRows ( maxrows ) ; } rows . populate ( resultSet ) ; return rows ; } catch ( SQLException e ) { throw new ControlException ( e . getMessage ( ) , e ) ; } }
Map a ResultSet to a RowSet . Type of RowSet is defined by the SQL annotation for the method .
9,115
public static FacesBackingBeanFactory get ( ServletContext servletContext ) { FacesBackingBeanFactory factory = ( FacesBackingBeanFactory ) servletContext . getAttribute ( CONTEXT_ATTR ) ; assert factory != null : FacesBackingBeanFactory . class . getName ( ) + " was not found in ServletContext attribute " + CONTEXT_ATTR ; factory . reinit ( servletContext ) ; return factory ; }
Get a FacesBackingBeanFactory .
9,116
public FacesBackingBean getFacesBackingBeanForRequest ( RequestContext requestContext ) { HttpServletRequest request = requestContext . getHttpRequest ( ) ; String uri = InternalUtils . getDecodedServletPath ( request ) ; assert uri . charAt ( 0 ) == '/' : uri ; String backingClassName = FileUtils . stripFileExtension ( uri . substring ( 1 ) . replace ( '/' , '.' ) ) ; FacesBackingBean currentBean = InternalUtils . getFacesBackingBean ( request , getServletContext ( ) ) ; if ( currentBean == null || ! currentBean . getClass ( ) . getName ( ) . equals ( backingClassName ) ) { FacesBackingBean bean = null ; if ( FileUtils . uriEndsWith ( uri , FACES_EXTENSION ) || FileUtils . uriEndsWith ( uri , JSF_EXTENSION ) ) { bean = loadFacesBackingBean ( requestContext , backingClassName ) ; if ( bean == null ) bean = new DefaultFacesBackingBean ( ) ; if ( bean != null ) { HttpServletResponse response = requestContext . getHttpResponse ( ) ; try { bean . create ( request , response , getServletContext ( ) ) ; } catch ( Exception e ) { _log . error ( "Error while creating backing bean instance of " + backingClassName , e ) ; } bean . persistInSession ( request , response ) ; return bean ; } } InternalUtils . removeCurrentFacesBackingBean ( request , getServletContext ( ) ) ; } else if ( currentBean != null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( "Using existing backing bean instance " + currentBean + " for request " + request . getRequestURI ( ) ) ; } currentBean . reinitialize ( request , requestContext . getHttpResponse ( ) , getServletContext ( ) ) ; } return currentBean ; }
Get the backing bean associated with the JavaServer Faces page for a request .
9,117
protected FacesBackingBean loadFacesBackingBean ( RequestContext requestContext , String backingClassName ) { try { Class backingClass = null ; try { backingClass = getFacesBackingBeanClass ( backingClassName ) ; } catch ( ClassNotFoundException e ) { } if ( backingClass == null ) { if ( _log . isTraceEnabled ( ) ) { _log . trace ( "No backing bean class " + backingClassName + " found for request " + requestContext . getHttpRequest ( ) . getRequestURI ( ) ) ; } } else { AnnotationReader annReader = AnnotationReader . getAnnotationReader ( backingClass , getServletContext ( ) ) ; if ( annReader . getJpfAnnotation ( backingClass , "FacesBacking" ) != null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( "Found backing class " + backingClassName + " for request " + requestContext . getHttpRequest ( ) . getRequestURI ( ) + "; creating a new instance." ) ; } return getFacesBackingBeanInstance ( backingClass ) ; } else { if ( _log . isDebugEnabled ( ) ) { _log . debug ( "Found matching backing class " + backingClassName + " for request " + requestContext . getHttpRequest ( ) . getRequestURI ( ) + ", but it does not have the " + ANNOTATION_QUALIFIER + "FacesBacking" + " annotation." ) ; } } } } catch ( InstantiationException e ) { _log . error ( "Could not create backing bean instance of " + backingClassName , e ) ; } catch ( IllegalAccessException e ) { _log . error ( "Could not create backing bean instance of " + backingClassName , e ) ; } return null ; }
Load a backing bean associated with the JavaServer Faces page for a request .
9,118
public FacesBackingBean getFacesBackingBeanInstance ( Class beanClass ) throws InstantiationException , IllegalAccessException { assert FacesBackingBean . class . isAssignableFrom ( beanClass ) : "Class " + beanClass . getName ( ) + " does not extend " + FacesBackingBean . class . getName ( ) ; return ( FacesBackingBean ) beanClass . newInstance ( ) ; }
Get a FacesBackingBean instance given a FacesBackingBean class .
9,119
public static ClassLoader getClassLoader ( ) { try { ClassLoader cl = Thread . currentThread ( ) . getContextClassLoader ( ) ; if ( cl != null ) return cl ; } catch ( SecurityException e ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( "Could not get thread context classloader." , e ) ; } } if ( _log . isTraceEnabled ( ) ) { _log . trace ( "Can't use thread context classloader; using classloader for " + DiscoveryUtils . class . getName ( ) ) ; } return DiscoveryUtils . class . getClassLoader ( ) ; }
Get the ClassLoader from which implementor classes will be discovered and loaded .
9,120
public static void init ( ServletContext servletContext ) { PageFlowFactoriesConfig factoriesBean = ConfigUtil . getConfig ( ) . getPageFlowFactories ( ) ; FlowControllerFactory factory = null ; if ( factoriesBean != null ) { PageFlowFactoryConfig fcFactoryBean = factoriesBean . getPageFlowFactory ( ) ; factory = ( FlowControllerFactory ) FactoryUtils . getFactory ( servletContext , fcFactoryBean , FlowControllerFactory . class ) ; } if ( factory == null ) factory = new FlowControllerFactory ( ) ; factory . reinit ( servletContext ) ; servletContext . setAttribute ( CONTEXT_ATTR , factory ) ; }
Initialize an instance of this class in the ServletContext . This is a framework - invoked method and should not normally be called directly .
9,121
public FlowController getFlowControllerInstance ( Class flowControllerClass ) throws InstantiationException , IllegalAccessException { assert FlowController . class . isAssignableFrom ( flowControllerClass ) : "Class " + flowControllerClass . getName ( ) + " does not extend " + FlowController . class . getName ( ) ; return ( FlowController ) flowControllerClass . newInstance ( ) ; }
Get a FlowController instance given a FlowController class .
9,122
protected void addOption ( AbstractRenderAppender buffer , String type , String optionValue , String optionDisplay , int idx , String altText , char accessKey , boolean disabled ) throws JspException { ServletRequest req = pageContext . getRequest ( ) ; if ( _cr == null ) _cr = TagRenderingBase . Factory . getConstantRendering ( req ) ; assert ( buffer != null ) ; assert ( optionValue != null ) ; assert ( optionDisplay != null ) ; assert ( type != null ) ; if ( _orientation != null && isVertical ( ) ) { _cr . TR_TD ( buffer ) ; } _inputState . clear ( ) ; _inputState . type = type ; _inputState . name = getQualifiedDataSourceName ( ) ; _inputState . value = optionValue ; _inputState . style = _style ; _inputState . styleClass = _class ; if ( isMatched ( optionValue , null ) ) { _inputState . checked = true ; } _inputState . disabled = isDisabled ( ) ; _inputState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , ALT , altText ) ; if ( accessKey != 0x00 ) _inputState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , ACCESSKEY , Character . toString ( accessKey ) ) ; if ( _attrs != null && _attrs . size ( ) > 0 ) { Iterator iterator = _attrs . keySet ( ) . iterator ( ) ; for ( ; iterator . hasNext ( ) ; ) { String key = ( String ) iterator . next ( ) ; if ( key == null ) continue ; String value = ( String ) _attrs . get ( key ) ; _inputState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , key , value ) ; } } TagRenderingBase br = TagRenderingBase . Factory . getRendering ( TagRenderingBase . INPUT_BOOLEAN_TAG , req ) ; br . doStartTag ( buffer , _inputState ) ; br . doEndTag ( buffer ) ; String ls = _labelStyle ; String lsc = _labelStyleClass ; _spanState . style = ls ; _spanState . styleClass = lsc ; br = TagRenderingBase . Factory . getRendering ( TagRenderingBase . SPAN_TAG , req ) ; br . doStartTag ( buffer , _spanState ) ; buffer . append ( optionDisplay ) ; br . doEndTag ( buffer ) ; if ( _orientation == null ) { _cr . BR ( buffer ) ; } else { if ( isVertical ( ) ) { _cr . TR_TD ( buffer ) ; } else { _cr . NBSP ( buffer ) ; } } }
This will create a new option in the HTML .
9,123
public int getTargetDocumentType ( ) { if ( _rendering != TagRenderingBase . UNKNOWN_RENDERING ) return _rendering ; if ( _docType != null ) { if ( _docType . equals ( HTML_401 ) ) _rendering = TagRenderingBase . HTML_RENDERING ; else if ( _docType . equals ( HTML_401_QUIRKS ) ) _rendering = TagRenderingBase . HTML_RENDERING_QUIRKS ; else if ( _docType . equals ( XHTML_10 ) ) _rendering = TagRenderingBase . XHTML_RENDERING ; else _rendering = TagRenderingBase . getDefaultDocType ( ) ; } else { _rendering = TagRenderingBase . getDefaultDocType ( ) ; } return _rendering ; }
This method will return the TagRenderBase enum value for the document type . The default value is HTML 4 . 01 .
9,124
public ArrayList returnErrors ( ) { if ( _containerErrors != null ) return _containerErrors . returnErrors ( ) ; ArrayList e = _errors ; _errors = null ; return e ; }
Return an ArrayList of the errors
9,125
public void check ( Declaration decl , AnnotationProcessorEnvironment env ) { _locale = Locale . getDefault ( ) ; if ( decl instanceof TypeDeclaration ) { Collection < ? extends MethodDeclaration > methods = ( ( TypeDeclaration ) decl ) . getMethods ( ) ; for ( MethodDeclaration method : methods ) { checkSQL ( method , env ) ; } } else if ( decl instanceof FieldDeclaration ) { } else { } }
Invoked by the control build - time infrastructure to process a declaration of a control extension ( ie an interface annotated with
9,126
public static TemplatedURLFormatter getTemplatedURLFormatter ( ServletContext servletContext ) { assert servletContext != null : "The ServletContext cannot be null." ; if ( servletContext == null ) { throw new IllegalArgumentException ( "The ServletContext cannot be null." ) ; } return ( TemplatedURLFormatter ) servletContext . getAttribute ( TEMPLATED_URL_FORMATTER_ATTR ) ; }
Gets the TemplatedURLFormatter instance from a ServletContext attribute .
9,127
public static void initServletContext ( ServletContext servletContext , TemplatedURLFormatter formatter ) { assert servletContext != null : "The ServletContext cannot be null." ; if ( servletContext == null ) { throw new IllegalArgumentException ( "The ServletContext cannot be null." ) ; } servletContext . setAttribute ( TEMPLATED_URL_FORMATTER_ATTR , formatter ) ; }
Adds a given TemplatedURLFormatter instance as an attribute on the ServletContext .
9,128
public static TemplatedURLFormatter getTemplatedURLFormatter ( ServletRequest servletRequest ) { assert servletRequest != null : "The ServletRequest cannot be null." ; if ( servletRequest == null ) { throw new IllegalArgumentException ( "The ServletRequest cannot be null." ) ; } return ( TemplatedURLFormatter ) servletRequest . getAttribute ( TEMPLATED_URL_FORMATTER_ATTR ) ; }
Gets the TemplatedURLFormatter instance from a ServletRequest attribute .
9,129
public static void initServletRequest ( ServletRequest servletRequest , TemplatedURLFormatter formatter ) { assert servletRequest != null : "The ServletRequest cannot be null." ; if ( servletRequest == null ) { throw new IllegalArgumentException ( "The ServletRequest cannot be null." ) ; } servletRequest . setAttribute ( TEMPLATED_URL_FORMATTER_ATTR , formatter ) ; }
Adds a given TemplatedURLFormatter instance as an attribute on the ServletRequest .
9,130
public int doEndTag ( ) throws JspException { Tag parent = getParent ( ) ; if ( parent instanceof CheckBoxGroup ) registerTagError ( Bundle . getString ( "Tags_CheckBoxGroupChildError" ) , null ) ; Object val = evaluateDataSource ( ) ; if ( hasErrors ( ) ) return reportAndExit ( EVAL_PAGE ) ; ByRef ref = new ByRef ( ) ; nameHtmlControl ( _state , ref ) ; String hiddenParamName = _state . name + OLDVALUE_SUFFIX ; ServletRequest req = pageContext . getRequest ( ) ; if ( val instanceof String ) { if ( val != null && Boolean . valueOf ( val . toString ( ) ) . booleanValue ( ) ) _state . checked = true ; else _state . checked = false ; } else if ( val instanceof Boolean ) { _state . checked = ( ( Boolean ) val ) . booleanValue ( ) ; } else { String oldCheckBoxValue = req . getParameter ( hiddenParamName ) ; if ( oldCheckBoxValue != null ) { _state . checked = new Boolean ( oldCheckBoxValue ) . booleanValue ( ) ; } else { _state . checked = evaluateDefaultValue ( ) ; } } _state . disabled = isDisabled ( ) ; String oldValue = req . getParameter ( _state . name ) ; WriteRenderAppender writer = new WriteRenderAppender ( pageContext ) ; if ( ! _state . disabled ) { _hiddenState . name = hiddenParamName ; if ( oldValue == null ) { _hiddenState . value = "false" ; } else { _hiddenState . value = oldValue ; } TagRenderingBase hiddenTag = TagRenderingBase . Factory . getRendering ( TagRenderingBase . INPUT_HIDDEN_TAG , req ) ; hiddenTag . doStartTag ( writer , _hiddenState ) ; hiddenTag . doEndTag ( writer ) ; } _state . type = INPUT_CHECKBOX ; TagRenderingBase br = TagRenderingBase . Factory . getRendering ( TagRenderingBase . INPUT_BOOLEAN_TAG , req ) ; br . doStartTag ( writer , _state ) ; if ( ! ref . isNull ( ) ) write ( ( String ) ref . getRef ( ) ) ; localRelease ( ) ; return EVAL_PAGE ; }
Render the checkbox .
9,131
public final synchronized void create ( HttpServletRequest request , HttpServletResponse response , ServletContext servletContext ) { reinitialize ( request , response , servletContext ) ; initializeSharedFlowFields ( request ) ; if ( isNestable ( ) ) { String vrClassName = request . getParameter ( InternalConstants . RETURN_ACTION_VIEW_RENDERER_PARAM ) ; if ( vrClassName != null ) { ViewRenderer vr = ( ViewRenderer ) DiscoveryUtils . newImplementorInstance ( vrClassName , ViewRenderer . class ) ; if ( vr != null ) { vr . init ( request ) ; PageFlowController nestingPageFlow = PageFlowUtils . getCurrentPageFlow ( request , servletContext ) ; nestingPageFlow . setReturnActionViewRenderer ( vr ) ; } } } super . create ( request , response , servletContext ) ; }
This is a framework method for initializing a newly - created page flow and should not normally be called directly .
9,132
public int getPage ( ) { int row = getRow ( ) ; assert row % getPageSize ( ) == 0 : "Invalid current row \"" + row + "\" for page size \"" + getPageSize ( ) + "\"" ; assert getPageSize ( ) > 0 ; return row / getPageSize ( ) ; }
Get the page number given the current page size and current row . The page number is zero based and should be adjusted by one when being displayed to users .
9,133
public void setPage ( int page ) { if ( page < 0 ) throw new IllegalArgumentException ( Bundle . getErrorString ( "PagerModel_IllegalPage" ) ) ; _currentRow = new Integer ( page * getPageSize ( ) ) ; }
Set a specific page . This will change the current row to match the given page value .
9,134
public int getRow ( ) { if ( _currentRow != null ) { int row = _currentRow . intValue ( ) ; if ( _dataSetSize != null && ( row > _dataSetSize . intValue ( ) ) ) row = _dataSetSize . intValue ( ) ; if ( row % getPageSize ( ) != 0 ) { int adjustedPage = row - ( row % getPageSize ( ) ) ; return adjustedPage ; } else return row ; } else return DEFAULT_ROW ; }
Get the current row . If no row has been specified the default row is returned .
9,135
public int getRowForLastPage ( ) { Integer lastRow = internalGetLastRow ( ) ; if ( lastRow != null ) return lastRow . intValue ( ) ; else throw new IllegalStateException ( Bundle . getErrorString ( "PagerModel_CantCalculateLastPage" ) ) ; }
Get the row used to display the last page . This requires tha the data set size has been set via
9,136
private Integer internalGetLastRow ( ) { if ( _dataSetSize != null ) { int lastRow = getPageSize ( ) * ( int ) Math . floor ( ( double ) ( _dataSetSize . intValue ( ) - 1 ) / ( double ) getPageSize ( ) ) ; return new Integer ( lastRow ) ; } else return null ; }
Internal method used to calculate the last row given a data set size .
9,137
Class getMethodMapClass ( Method method ) { Class origMapClass = method . getDeclaringClass ( ) ; Class mapClass = origMapClass ; while ( mapClass != null && ! isValidMapClass ( mapClass ) ) { mapClass = mapClass . getDeclaringClass ( ) ; } if ( mapClass == null ) { mapClass = origMapClass ; } return mapClass ; }
further in the hierarchy .
9,138
private String getMethodArgs ( Method m ) { StringBuffer sb = new StringBuffer ( ) ; Class [ ] argTypes = m . getParameterTypes ( ) ; for ( int i = 0 ; i < argTypes . length ; i ++ ) { if ( i != 0 ) sb . append ( "," ) ; sb . append ( argTypes [ i ] . toString ( ) ) ; } return sb . toString ( ) ; }
Returns a String version of method argument lists based upon the method argument types
9,139
private void writeObject ( java . io . ObjectOutputStream out ) throws IOException { if ( _annotElem instanceof Class ) { _elemClass = ( Class ) _annotElem ; _elemDesc = null ; } else if ( _annotElem instanceof Field ) { Field f = ( Field ) _annotElem ; _elemClass = f . getDeclaringClass ( ) ; _elemDesc = f . getName ( ) ; } else if ( _annotElem instanceof Method ) { Method m = ( Method ) _annotElem ; _elemClass = m . getDeclaringClass ( ) ; _elemDesc = m . getName ( ) + "(" + getMethodArgs ( m ) + ")" ; } out . defaultWriteObject ( ) ; }
Overrides the standard Serialization writeObject method to compute and store the element information in a serializable form .
9,140
private void readObject ( java . io . ObjectInputStream in ) throws IOException , ClassNotFoundException { in . defaultReadObject ( ) ; if ( _elemDesc == null ) _annotElem = _elemClass ; else { int argsIndex = _elemDesc . indexOf ( '(' ) ; if ( argsIndex < 0 ) { try { _annotElem = _elemClass . getDeclaredField ( _elemDesc ) ; } catch ( NoSuchFieldException nsfe ) { throw new IOException ( "Unable to locate field " + nsfe ) ; } } else { String methodName = _elemDesc . substring ( 0 , argsIndex ) ; if ( _elemDesc . charAt ( argsIndex + 1 ) == ')' ) { try { _annotElem = _elemClass . getDeclaredMethod ( methodName , new Class [ ] { } ) ; } catch ( NoSuchMethodException nsme ) { throw new IOException ( "Unable to locate method " + _elemDesc ) ; } } else { String methodArgs = _elemDesc . substring ( argsIndex + 1 , _elemDesc . length ( ) - 1 ) ; Method [ ] methods = _elemClass . getDeclaredMethods ( ) ; for ( int i = 0 ; i < methods . length ; i ++ ) { if ( methods [ i ] . getName ( ) . equals ( methodName ) && getMethodArgs ( methods [ i ] ) . equals ( methodArgs ) ) { _annotElem = methods [ i ] ; break ; } } if ( _annotElem == null ) { throw new IOException ( "Unable to locate method " + _elemDesc ) ; } } } } }
Overrides the standard Serialization readObject implementation to reassociated with the target AnnotatedElement after deserialization .
9,141
public int doStartTag ( ) throws JspException { String realName = rewriteName ( _name ) ; if ( _resultId != null ) pageContext . setAttribute ( _resultId , realName ) ; IScriptReporter scriptReporter = getScriptReporter ( ) ; ScriptRequestState srs = ScriptRequestState . getScriptRequestState ( ( HttpServletRequest ) pageContext . getRequest ( ) ) ; if ( TagConfig . isLegacyJavaScript ( ) ) { srs . mapLegacyTagId ( scriptReporter , _name , realName ) ; } write ( realName ) ; localRelease ( ) ; return SKIP_BODY ; }
Pass the name attribute to the URLRewriter and output the returned value . Updates the HTML tag to output the mapping .
9,142
public boolean isAbsolute ( ) { int colonIndex = namespace . indexOf ( ':' ) ; if ( colonIndex == - 1 ) { return false ; } for ( int i = 0 ; i < colonIndex ; i ++ ) { char ch = namespace . charAt ( i ) ; if ( ! Character . isLetter ( ch ) && ! Character . isDigit ( ch ) && ch != '.' && ch != '+' && ch != '-' ) { return false ; } } return true ; }
Determines if this IRI is absolute
9,143
public Map < String , Type > extractValues ( XAttributable element ) { Map < String , Type > values = new HashMap < String , Type > ( ) ; Map < List < String > , Type > nestedValues = extractNestedValues ( element ) ; for ( List < String > keys : nestedValues . keySet ( ) ) { if ( keys . size ( ) == 1 ) { values . put ( keys . get ( 0 ) , nestedValues . get ( keys ) ) ; } } return values ; }
Retrieves a map containing all values for all child attributes of an element .
9,144
public Map < List < String > , Type > extractNestedValues ( XAttributable element ) { Map < List < String > , Type > nestedValues = new HashMap < List < String > , Type > ( ) ; for ( XAttribute attr : element . getAttributes ( ) . values ( ) ) { List < String > keys = new ArrayList < String > ( ) ; keys . add ( attr . getKey ( ) ) ; extractNestedValuesPrivate ( attr , nestedValues , keys ) ; } return nestedValues ; }
Retrieves a map containing all values for all descending attributes of an element .
9,145
public String formatMessage ( String key , Object [ ] args ) { String msg = internalFormatMessage ( getMessage ( key ) , args ) ; return msg ; }
Format a message associated with the given key and with the given message arguments .
9,146
private String getDefaultMessage ( String key ) { if ( _defaultResourceBundle == null ) _defaultResourceBundle = createResourceBundle ( DEFAULT_RESOURCE_BUNDLE ) ; return _defaultResourceBundle . getString ( key ) ; }
Get a message with the given key from the default message bundle .
9,147
protected Object arrayFromResultSet ( ResultSet rs , int maxRows , Class arrayClass , Calendar cal ) throws SQLException { ArrayList < Object > list = new ArrayList < Object > ( ) ; Class componentType = arrayClass . getComponentType ( ) ; RowMapper rowMapper = RowMapperFactory . getRowMapper ( rs , componentType , cal ) ; if ( maxRows == 0 ) { maxRows = - 1 ; } int numRows ; boolean hasMoreRows = rs . next ( ) ; for ( numRows = 0 ; numRows != maxRows && hasMoreRows ; numRows ++ ) { list . add ( rowMapper . mapRowToReturnType ( ) ) ; hasMoreRows = rs . next ( ) ; } Object array = Array . newInstance ( componentType , numRows ) ; try { for ( int i = 0 ; i < numRows ; i ++ ) { Array . set ( array , i , list . get ( i ) ) ; } } catch ( IllegalArgumentException iae ) { ResultSetMetaData md = rs . getMetaData ( ) ; throw new ControlException ( "The declared Java type for array " + componentType . getName ( ) + "is incompatible with the SQL format of column " + md . getColumnName ( 1 ) + md . getColumnTypeName ( 1 ) + "which returns objects of type + " + list . get ( 0 ) . getClass ( ) . getName ( ) ) ; } return array ; }
Invoked when the return type of the method is an array type .
9,148
public void addParameter ( String name , Object value , String facet ) throws JspException { assert ( name != null ) : "Parameter 'name' must not be null" ; if ( _params == null ) { _params = new HashMap ( ) ; } ParamHelper . addParam ( _params , name , value ) ; }
Adds a URL parameter to the generated hyperlink .
9,149
public void setAlt ( String alt ) { _imageState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . ALT , alt ) ; }
Sets the alt text attribute for the HTML image tag .
9,150
public void setLongdesc ( String longdesc ) { _imageState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . LONGDESC , longdesc ) ; }
Sets the longdesc attribute for the HTML image tag .
9,151
public void setHeight ( String height ) { _imageState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . HEIGHT , height ) ; }
Sets the image height attribute for the HTML image tag .
9,152
public void setHspace ( String hspace ) { _imageState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . HSPACE , hspace ) ; }
Sets the the horizontal spacing attribute for the HTML image tag .
9,153
public void setIsmap ( String ismap ) { _imageState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . ISMAP , ismap ) ; }
Sets the server - side image map declaration for the HTML image tag .
9,154
public void setUsemap ( String usemap ) { _imageState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . USEMAP , usemap ) ; }
Sets the client - side image map declaration for the HTML iage tag .
9,155
public void setVspace ( String vspace ) { _imageState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . VSPACE , vspace ) ; }
Sets the vertical spacing around the HTML image tag .
9,156
private boolean setCallableStatement ( Object [ ] args ) { if ( args != null && args . length == 1 && args [ 0 ] != null ) { Class argClass = args [ 0 ] . getClass ( ) ; if ( argClass . isArray ( ) && JdbcControl . SQLParameter . class . isAssignableFrom ( argClass . getComponentType ( ) ) ) { return true ; } } return false ; }
Determine if this SQL will generate a callable or prepared statement .
9,157
private void doBatchUpdate ( PreparedStatement ps , Object [ ] args , Calendar cal ) throws SQLException { final int [ ] sqlTypes = new int [ args . length ] ; final Object [ ] objArrays = new Object [ args . length ] ; for ( int i = 0 ; i < args . length ; i ++ ) { sqlTypes [ i ] = _tmf . getSqlType ( args [ i ] . getClass ( ) . getComponentType ( ) ) ; objArrays [ i ] = TypeMappingsFactory . toObjectArray ( args [ i ] ) ; } final int rowCount = ( ( Object [ ] ) objArrays [ 0 ] ) . length ; for ( int i = 0 ; i < rowCount ; i ++ ) { for ( int j = 0 ; j < args . length ; j ++ ) { setPreparedStatementParameter ( ps , j + 1 , ( ( Object [ ] ) objArrays [ j ] ) [ i ] , sqlTypes [ j ] , cal ) ; } ps . addBatch ( ) ; } }
Build a prepared statement for a batch update .
9,158
private void loadSQLAnnotationStatmentOptions ( ControlBeanContext context , Method method ) { final JdbcControl . SQL methodSQL = ( JdbcControl . SQL ) context . getMethodPropertySet ( method , JdbcControl . SQL . class ) ; _batchUpdate = methodSQL . batchUpdate ( ) ; _getGeneratedKeys = methodSQL . getGeneratedKeys ( ) ; _genKeyColumnNames = methodSQL . generatedKeyColumnNames ( ) ; _genKeyColumnIndexes = methodSQL . generatedKeyColumnIndexes ( ) ; _scrollType = methodSQL . scrollableResultSet ( ) ; _fetchDirection = methodSQL . fetchDirection ( ) ; _fetchSize = methodSQL . fetchSize ( ) ; _maxRows = methodSQL . maxRows ( ) ; _maxArray = methodSQL . arrayMaxLength ( ) ; _holdability = methodSQL . resultSetHoldabilityOverride ( ) ; }
Load element values from the SQL annotation which apply to Statements .
9,159
private void checkJdbcSupport ( DatabaseMetaData metaData ) throws SQLException { if ( _getGeneratedKeys && ! metaData . supportsGetGeneratedKeys ( ) ) { throw new ControlException ( "The database does not support getGeneratedKeys." ) ; } if ( _batchUpdate && ! metaData . supportsBatchUpdates ( ) ) { throw new ControlException ( "The database does not support batchUpdates." ) ; } if ( _scrollType != JdbcControl . ScrollType . DRIVER_DEFAULT && ! metaData . supportsResultSetConcurrency ( _scrollType . getType ( ) , _scrollType . getConcurrencyType ( ) ) ) { throw new ControlException ( "The database does not support the ResultSet concurrecy type: " + _scrollType . toString ( ) ) ; } if ( _holdability != JdbcControl . HoldabilityType . DRIVER_DEFAULT && ! metaData . supportsResultSetHoldability ( _holdability . getHoldability ( ) ) ) { throw new ControlException ( "The database does not support the ResultSet holdability type: " + _holdability . toString ( ) ) ; } }
Checks that all statement options specified in annotation are supported by the database .
9,160
private void initTypeParameterBindings ( ) { DeclaredType fieldType = ( DeclaredType ) _fieldDecl . getType ( ) ; Iterator < TypeMirror > paramBoundIter = fieldType . getActualTypeArguments ( ) . iterator ( ) ; TypeDeclaration intfDecl = ( TypeDeclaration ) _controlIntf . getTypeDeclaration ( ) ; Iterator < TypeParameterDeclaration > paramDeclIter = intfDecl . getFormalTypeParameters ( ) . iterator ( ) ; StringBuffer sb = new StringBuffer ( ) ; boolean isFirst = true ; while ( paramBoundIter . hasNext ( ) ) { TypeMirror paramBound = paramBoundIter . next ( ) ; TypeParameterDeclaration paramDecl = paramDeclIter . next ( ) ; _typeBindingMap . put ( paramDecl . getSimpleName ( ) , paramBound ) ; if ( isFirst ) { sb . append ( "<" ) ; isFirst = false ; } else sb . append ( ", " ) ; sb . append ( paramBound ) ; } if ( ! isFirst ) sb . append ( ">" ) ; _boundParameterDecl = sb . toString ( ) ; }
Computes the binding from any formal type parameters declared on the control interface to bound types on the field declaration .
9,161
public AptControlInterface getControlInterface ( ) { if ( _controlIntf == null ) { _controlIntf = initControlInterface ( ) ; if ( _controlIntf != null ) initTypeParameterBindings ( ) ; } return _controlIntf ; }
Returns the ControlInterface associated with this event field
9,162
public void addEventAdaptor ( AptEventSet eventSet , EventAdaptor eventAdaptor ) { assert ! _eventAdaptors . containsKey ( eventSet ) ; _eventAdaptors . put ( eventSet , eventAdaptor ) ; }
Adds a EventAdaptor for a particular EventSet
9,163
public void setSummary ( String summary ) { _tableState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . SUMMARY , summary ) ; }
Sets the summary attribute for the HTML table tag .
9,164
public void setWidth ( String width ) { _tableState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . WIDTH , width ) ; }
Sets the width attribute for the HTML table tag .
9,165
public void setBorder ( String border ) { _tableState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . BORDER , border ) ; }
Sets the border attribute for the HTML table tag .
9,166
public void setFrame ( String frame ) { _tableState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . FRAME , frame ) ; }
Sets the frame attribute for the HTML table tag .
9,167
public void setRules ( String rules ) { _tableState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . RULES , rules ) ; }
Sets the rules attribute for the HTML table tag .
9,168
public void setCellspacing ( String cellspacing ) { _tableState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . CELLSPACING , cellspacing ) ; }
Sets the cellspacing attribute for the HTML table tag .
9,169
public void setCellpadding ( String cellpadding ) { _tableState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . CELLPADDING , cellpadding ) ; }
Sets the cellpadding attribute for the HTML table tag .
9,170
public Iterator mapToResultType ( ControlBeanContext context , Method m , ResultSet resultSet , Calendar cal ) { return new ResultSetIterator ( context , m , resultSet , cal ) ; }
Map a ResultSet to an object type Type of object to interate over is defined in the SQL annotation for the method .
9,171
public boolean containsContextsWithACModel ( AbstractACModel acModel ) { for ( ProcessContext context : getComponents ( ) ) { if ( context . getACModel ( ) . equals ( acModel ) ) { return true ; } } return false ; }
Checks if there are contexts whose access control model equals the given model .
9,172
public List < E > getEntriesForActivities ( Set < String > activities ) { Validate . noNullElements ( activities ) ; List < E > result = new ArrayList < > ( ) ; for ( E entry : logEntries ) { if ( activities . contains ( entry . getActivity ( ) ) ) { result . add ( entry ) ; } } return result ; }
Returns all log entries of this trace whose activities are in the given activity set .
9,173
public List < XLog > parse ( InputStream is ) throws Exception { BufferedInputStream bis = new BufferedInputStream ( is ) ; XesXmlHandler handler = new XesXmlHandler ( ) ; SAXParserFactory parserFactory = SAXParserFactory . newInstance ( ) ; parserFactory . setNamespaceAware ( false ) ; SAXParser parser = parserFactory . newSAXParser ( ) ; parser . parse ( bis , handler ) ; bis . close ( ) ; ArrayList < XLog > wrapper = new ArrayList < XLog > ( ) ; wrapper . add ( handler . getLog ( ) ) ; return wrapper ; }
Parses a log from the given input stream which is supposed to deliver an XES log in XML representation .
9,174
protected PageContext getPageContext ( ) { JspContext ctxt = getJspContext ( ) ; if ( ctxt instanceof PageContext ) return ( PageContext ) ctxt ; assert ( false ) : "The JspContext was not a PageContext" ; logger . error ( "The JspContext was not a PageContext" ) ; return null ; }
This method will attempt to cast the JspContext into a PageContext . If this fails it will log an exception .
9,175
protected IScriptReporter getHtmlTag ( ServletRequest req ) { Html html = ( Html ) req . getAttribute ( Html . HTML_TAG_ID ) ; if ( html != null && html instanceof IScriptReporter ) return ( IScriptReporter ) html ; return null ; }
This method will return the scriptReporter that is represented by the HTML tag .
9,176
public TypeInstance addReturnAction ( String returnActionName , AnnotationInstance annotation , TypeDeclaration outerType ) { TypeInstance formBeanType = CompilerUtils . getTypeInstance ( annotation , OUTPUT_FORM_BEAN_TYPE_ATTR , true ) ; if ( formBeanType == null ) { String memberFieldName = CompilerUtils . getString ( annotation , OUTPUT_FORM_BEAN_ATTR , true ) ; if ( memberFieldName != null ) { FieldDeclaration field = CompilerUtils . findField ( outerType , memberFieldName ) ; if ( field != null ) formBeanType = field . getType ( ) ; } } String formTypeName = formBeanType != null && formBeanType instanceof DeclaredType ? CompilerUtils . getDeclaration ( ( DeclaredType ) formBeanType ) . getQualifiedName ( ) : null ; addReturnAction ( returnActionName , formTypeName ) ; return formBeanType ; }
Add a return - action from an annotation .
9,177
protected void registerTagError ( String message , Throwable e ) throws JspException { System . err . println ( "Error in rendering tree:" + message ) ; logger . error ( message , e ) ; }
Errors during rendering will call through this method . During the XmlHttpRequest these will just be logged and we will go on .
9,178
protected void addGlobalAttributes ( SXTag parent , String scope , List < XAttribute > attributes ) throws IOException { if ( attributes . size ( ) > 0 ) { SXTag guaranteedNode = parent . addChildNode ( "global" ) ; guaranteedNode . addAttribute ( "scope" , scope ) ; addAttributes ( guaranteedNode , attributes ) ; } }
Helper method for defining global attributes on a given scope .
9,179
protected void addAttributes ( SXTag tag , Collection < XAttribute > attributes ) throws IOException { for ( XAttribute attribute : attributes ) { SXTag attributeTag ; if ( attribute instanceof XAttributeList ) { attributeTag = tag . addChildNode ( "list" ) ; attributeTag . addAttribute ( "key" , attribute . getKey ( ) ) ; } else if ( attribute instanceof XAttributeContainer ) { attributeTag = tag . addChildNode ( "container" ) ; attributeTag . addAttribute ( "key" , attribute . getKey ( ) ) ; } else if ( attribute instanceof XAttributeLiteral ) { attributeTag = tag . addChildNode ( "string" ) ; attributeTag . addAttribute ( "key" , attribute . getKey ( ) ) ; attributeTag . addAttribute ( "value" , attribute . toString ( ) ) ; } else if ( attribute instanceof XAttributeDiscrete ) { attributeTag = tag . addChildNode ( "int" ) ; attributeTag . addAttribute ( "key" , attribute . getKey ( ) ) ; attributeTag . addAttribute ( "value" , attribute . toString ( ) ) ; } else if ( attribute instanceof XAttributeContinuous ) { attributeTag = tag . addChildNode ( "float" ) ; attributeTag . addAttribute ( "key" , attribute . getKey ( ) ) ; attributeTag . addAttribute ( "value" , attribute . toString ( ) ) ; } else if ( attribute instanceof XAttributeTimestamp ) { attributeTag = tag . addChildNode ( "date" ) ; attributeTag . addAttribute ( "key" , attribute . getKey ( ) ) ; Date timestamp = ( ( XAttributeTimestamp ) attribute ) . getValue ( ) ; attributeTag . addAttribute ( "value" , xsDateTimeConversion . format ( timestamp ) ) ; } else if ( attribute instanceof XAttributeBoolean ) { attributeTag = tag . addChildNode ( "boolean" ) ; attributeTag . addAttribute ( "key" , attribute . getKey ( ) ) ; attributeTag . addAttribute ( "value" , attribute . toString ( ) ) ; } else if ( attribute instanceof XAttributeID ) { attributeTag = tag . addChildNode ( "id" ) ; attributeTag . addAttribute ( "key" , attribute . getKey ( ) ) ; attributeTag . addAttribute ( "value" , attribute . toString ( ) ) ; } else { throw new IOException ( "Unknown attribute type!" ) ; } if ( attribute instanceof XAttributeCollection ) { Collection < XAttribute > childAttributes = ( ( XAttributeCollection ) attribute ) . getCollection ( ) ; addAttributes ( attributeTag , childAttributes ) ; } else { addAttributes ( attributeTag , attribute . getAttributes ( ) . values ( ) ) ; } } }
Helper method adds the given collection of attributes to the given Tag .
9,180
public synchronized boolean consolidate ( ) throws IOException { if ( isTainted ( ) ) { XSequentialEventBuffer nBuffer = new XSequentialEventBuffer ( buffer . getProvider ( ) , this . attributeMapSerializer ) ; int overflowIndex = 0 ; int fileBufferIndex = 0 ; for ( int i = 0 ; i < size ; i ++ ) { if ( overflowIndex < overflowSize && overflowIndices [ overflowIndex ] == i ) { nBuffer . append ( overflowEntries [ overflowIndex ] ) ; overflowIndex ++ ; } else { while ( holeFlags . get ( fileBufferIndex ) == true ) { fileBufferIndex ++ ; } nBuffer . append ( buffer . get ( fileBufferIndex ) ) ; fileBufferIndex ++ ; } } buffer . cleanup ( ) ; buffer = nBuffer ; overflowSize = 0 ; holeFlags . clear ( ) ; return true ; } else { return false ; } }
Consolidates this fast event list . Consolidation implies that all overflow and skipping data structures are freed and the buffered representation is brought completely in - line with the virtual current contents of the list .
9,181
public synchronized XEvent get ( int index ) throws IndexOutOfBoundsException , IOException { if ( index < 0 || index >= size ) { throw new IndexOutOfBoundsException ( ) ; } int bufferIndex = index ; for ( int i = 0 ; i < overflowSize ; i ++ ) { if ( overflowIndices [ i ] == index ) { return overflowEntries [ i ] ; } else if ( overflowIndices [ i ] < index ) { bufferIndex -- ; } else { break ; } } for ( int hole = holeFlags . nextSetBit ( 0 ) ; hole >= 0 && hole <= bufferIndex ; hole = holeFlags . nextSetBit ( hole + 1 ) ) { bufferIndex ++ ; } return buffer . get ( bufferIndex ) ; }
Retrieves an event at a specific index in the list .
9,182
public synchronized void insert ( XEvent event , int index ) throws IndexOutOfBoundsException , IOException { if ( index < 0 || index > size ) { throw new IndexOutOfBoundsException ( ) ; } if ( index == size ) { append ( event ) ; return ; } size ++ ; overflowSize ++ ; for ( int i = overflowSize - 2 ; i >= 0 ; i -- ) { if ( overflowIndices [ i ] >= index ) { overflowIndices [ i + 1 ] = overflowIndices [ i ] + 1 ; overflowEntries [ i + 1 ] = overflowEntries [ i ] ; } else { overflowIndices [ i + 1 ] = index ; overflowEntries [ i + 1 ] = event ; if ( overflowSize == overflowIndices . length ) { consolidate ( ) ; } return ; } } overflowIndices [ 0 ] = index ; overflowEntries [ 0 ] = event ; if ( overflowSize == overflowIndices . length ) { consolidate ( ) ; } }
Inserts an event at a given index into the list .
9,183
public synchronized XEvent remove ( int index ) throws IndexOutOfBoundsException , IOException { XEvent removed = null ; int smallerOverflow = 0 ; for ( int i = 0 ; i < overflowSize ; i ++ ) { if ( overflowIndices [ i ] == index ) { removed = overflowEntries [ i ] ; } else if ( overflowIndices [ i ] > index ) { overflowIndices [ i ] = overflowIndices [ i ] - 1 ; if ( removed != null ) { overflowIndices [ i - 1 ] = overflowIndices [ i ] ; overflowEntries [ i - 1 ] = overflowEntries [ i ] ; } } else if ( overflowIndices [ i ] < index ) { smallerOverflow ++ ; } } if ( removed != null ) { overflowSize -- ; overflowIndices [ overflowSize ] = - 1 ; overflowEntries [ overflowSize ] = null ; } else { int bufferIndex = index - smallerOverflow ; for ( int hole = holeFlags . nextSetBit ( 0 ) ; hole >= 0 && hole <= bufferIndex ; hole = holeFlags . nextSetBit ( hole + 1 ) ) { bufferIndex ++ ; } removed = buffer . get ( bufferIndex ) ; holeFlags . set ( bufferIndex , true ) ; } size -- ; return removed ; }
Removes the event at the given index from this list .
9,184
public synchronized XEvent replace ( XEvent event , int index ) throws IndexOutOfBoundsException , IOException { XEvent replaced = null ; int smallerOverflow = 0 ; for ( int i = 0 ; i < overflowSize ; i ++ ) { if ( overflowIndices [ i ] == index ) { replaced = overflowEntries [ i ] ; overflowEntries [ i ] = event ; return replaced ; } else if ( overflowIndices [ i ] > index ) { break ; } else if ( overflowIndices [ i ] < index ) { smallerOverflow ++ ; } } int bufferIndex = index - smallerOverflow ; for ( int hole = holeFlags . nextSetBit ( 0 ) ; hole >= 0 && hole <= bufferIndex ; hole = holeFlags . nextSetBit ( hole + 1 ) ) { bufferIndex ++ ; } replaced = buffer . get ( bufferIndex ) ; if ( buffer . replace ( event , bufferIndex ) == false ) { remove ( index ) ; insert ( event , index ) ; } return replaced ; }
Replaces the event at the given index with another event .
9,185
protected Object resolveBeanInstance ( ) { Object fromHandle = resolveBeanInstanceFromHandle ( ) ; if ( fromHandle != null ) return fromHandle ; try { Method createMethod = _homeInterface . getMethod ( "create" , new Class [ ] { } ) ; Object beanInstance = createMethod . invoke ( _homeInstance , ( Object [ ] ) null ) ; _autoCreated = true ; return beanInstance ; } catch ( NoSuchMethodException e ) { throw new ControlException ( "Cannot auto-create session bean instance because no null argument create() method exists. To use this bean, you will need to call create() directly with the appropriate parameters" ) ; } catch ( InvocationTargetException e ) { _lastException = e . getTargetException ( ) ; throw new ControlException ( "Unable to create session bean instance" , _lastException ) ; } catch ( Exception e ) { throw new ControlException ( "Unable to invoke home interface create method" , e ) ; } }
Implements auto - create semantics for Session beans .
9,186
protected void filter ( String value , AbstractRenderAppender writer , boolean markupHTMLSpaceReturn ) { if ( value . equals ( " " ) ) { writer . append ( "&nbsp;" ) ; return ; } HtmlUtils . filter ( value , writer , markupHTMLSpaceReturn ) ; }
Filter the specified string for characters that are senstive to HTML interpreters returning the string with these characters replaced by the corresponding character entities .
9,187
public void addParameter ( String name , String value ) { if ( _additionalParameters == null ) { _additionalParameters = new HashMap ( ) ; } _additionalParameters . put ( name , value ) ; }
Add a parameter to the request .
9,188
public String getListenScopeParameter ( String paramName ) { String retVal = null ; if ( _listenScopes != null ) { for ( int i = 0 , len = _listenScopes . size ( ) ; retVal == null && i < len ; ++ i ) { String key = ScopedServletUtils . getScopedName ( paramName , _listenScopes . get ( i ) ) ; retVal = getRequest ( ) . getParameter ( key ) ; } } return retVal ; }
Get the parameter from the listen scoped requests
9,189
public void addListenScope ( Object scopeKey ) { assert scopeKey != null ; if ( _listenScopes == null ) { _listenScopes = new ArrayList ( ) ; } _listenScopes . add ( scopeKey ) ; }
Adds a scope to listen to . This scope will see all request parameters from a ScopedRequest of the given scope .
9,190
public void persistAttributes ( ) { String attrName = getScopedName ( STORED_ATTRS_ATTR ) ; getSession ( ) . setAttribute ( attrName , _scopedContainer . getSerializableAttrs ( ) ) ; }
Stores the current map of request attributes in the Session .
9,191
public void restoreAttributes ( ) { String attrName = getScopedName ( STORED_ATTRS_ATTR ) ; Map savedAttrs = ( Map ) getSession ( ) . getAttribute ( attrName ) ; if ( savedAttrs != null ) { setAttributeMap ( savedAttrs ) ; } }
Restores the map of request attributes from a map saved in the Session .
9,192
PageFlowController popUntil ( HttpServletRequest request , Class stopAt , boolean onlyIfPresent ) { if ( onlyIfPresent && lastIndexOf ( stopAt ) == - 1 ) { return null ; } while ( ! isEmpty ( ) ) { PageFlowController popped = pop ( request ) . getPageFlow ( ) ; if ( popped . getClass ( ) . equals ( stopAt ) ) { if ( isEmpty ( ) ) destroy ( request ) ; return popped ; } else { if ( ! popped . isLongLived ( ) ) popped . destroy ( request . getSession ( false ) ) ; } } destroy ( request ) ; return null ; }
Pop page flows from the nesting stack until one of the given type is found .
9,193
public void push ( PageFlowController pageFlow , HttpServletRequest request ) { ActionInterceptorContext interceptorContext = ActionInterceptorContext . getActiveContext ( request , true ) ; if ( interceptorContext != null ) { ActionInterceptor interceptor = interceptorContext . getOverridingActionInterceptor ( ) ; InterceptorForward originalForward = interceptorContext . getOriginalForward ( ) ; String actionName = interceptorContext . getActionName ( ) ; _stack . push ( new PushedPageFlow ( pageFlow , interceptor , originalForward , actionName ) ) ; } else { _stack . push ( new PushedPageFlow ( pageFlow ) ) ; } pageFlow . setIsOnNestingStack ( true ) ; ensureFailover ( request , getServletContext ( ) ) ; }
Push a page flow onto the stack of nested page flows in the session .
9,194
public PushedPageFlow pop ( HttpServletRequest request ) { PushedPageFlow ppf = ( PushedPageFlow ) _stack . pop ( ) ; PageFlowController pfc = ppf . getPageFlow ( ) ; pfc . setIsOnNestingStack ( false ) ; if ( request != null ) { ServletContext servletContext = getServletContext ( ) ; pfc . reinitialize ( request , null , servletContext ) ; ensureFailover ( request , servletContext ) ; } return ppf ; }
Pop the most recently - pushed page flow from the stack of nested page flows in the session .
9,195
Stack getLegacyStack ( ) { Stack ret = new Stack ( ) ; for ( int i = 0 ; i < _stack . size ( ) ; ++ i ) { ret . push ( ( ( PushedPageFlow ) _stack . get ( i ) ) . getPageFlow ( ) ) ; } return ret ; }
Get a stack of PageFlowControllers not of PushedPageFlows .
9,196
protected synchronized XAttributeMap deserialize ( ) throws IOException { if ( this . size == 0 ) { return new XAttributeMapLazyImpl < XAttributeMapImpl > ( XAttributeMapImpl . class ) ; } else { if ( cacheMap != null && cacheMap . get ( ) != null ) { return cacheMap . get ( ) ; } else { storage . seek ( 0 ) ; XAttributeMap deserialized = this . serializer . deserialize ( storage ) ; cacheMap = new WeakReference < XAttributeMap > ( deserialized ) ; return deserialized ; } } }
Retrieves a quick - access representation of this attribute map for actual usage . De - buffers the attribute map and creates an in - memory representation which should be discarded after use to free memory .
9,197
protected synchronized void serialize ( XAttributeMap map ) throws IOException { storage . seek ( 0 ) ; serializer . serialize ( map , storage ) ; cacheMap = new WeakReference < XAttributeMap > ( map ) ; this . size = map . size ( ) ; map = null ; }
Serializes the given attribute map to a disk - buffered representation .
9,198
protected Set < OWLAnnotation > mergeAnnos ( Set < OWLAnnotation > annos ) { Set < OWLAnnotation > merged = new HashSet < > ( annos ) ; merged . addAll ( annotations ) ; return merged ; }
A convenience method for implementation that returns a set containing the annotations on this axiom plus the annotations in the specified set .
9,199
public Vector add ( Vector vec ) { x += vec . x ; y += vec . y ; z += vec . z ; return this ; }
Adds a vector to this one