idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
9,500
public final void writeChildren ( ObjectOutputStream oos ) throws IOException { int serializable = 0 ; Set < Map . Entry < Object , BCChild > > bcChildren = _children . entrySet ( ) ; for ( Map . Entry < Object , BCChild > entry : bcChildren ) { if ( entry . getValue ( ) . isSerializable ( ) ) { serializable ++ ; } } o...
Necessary for the case of this bean context having a peer . The specification states that a bean context which has a peer should not serialize its children this hook is necessary to allow the peer to serialize children .
9,501
private synchronized void readObject ( ObjectInputStream in ) throws IOException , ClassNotFoundException { in . defaultReadObject ( ) ; initialize ( ) ; if ( this . equals ( getPeer ( ) ) ) { readChildren ( in ) ; } int listenerCount = in . readInt ( ) ; for ( int i = 0 ; i < listenerCount ; i ++ ) { addBeanContextMem...
Deserialize this an instance of this class including any children and BeanContextMembershipListeners which were present during serialization and were serializable .
9,502
public final void readChildren ( ObjectInputStream in ) throws IOException , ClassNotFoundException { int childCount = in . readInt ( ) ; for ( int i = 0 ; i < childCount ; i ++ ) { internalAdd ( in . readObject ( ) , false ) ; } }
This public api is necessary to allow a bean context with a peer to deserialize its children . This api is not part any standard api .
9,503
public static HttpResult executeSearch ( AsyncHttpClient client , HttpMethod method , String host , String path , String searchQuery ) { RequestBuilder requestBuilder = new RequestBuilder ( method . name ( ) ) ; log . debug ( "Executing request against host {} with path {}" , host , path ) ; if ( searchQuery != null ) ...
Executes a blocking request .
9,504
public static OS determineOS ( ) { if ( currentOs == null ) { String osString = System . getProperty ( "os.name" ) . trim ( ) . toLowerCase ( ) ; if ( osString . startsWith ( "windows" ) ) { currentOs = OS . WIN32 ; } else if ( osString . startsWith ( "mac os x" ) ) { currentOs = OS . MACOSX ; } else if ( osString . st...
Determines the current host platform .
9,505
public static boolean isRunningUnix ( ) { OS os = XRuntimeUtils . determineOS ( ) ; if ( os . equals ( OS . BSD ) || os . equals ( OS . LINUX ) || os . equals ( OS . MACOSX ) ) { return true ; } else { return false ; } }
Checks whether the current platform is some flavor of Unix .
9,506
public static String getSupportFolder ( ) { String homedir = System . getProperty ( "user.home" ) ; String dirName = "OpenXES" ; if ( isRunningWindows ( ) ) { ( new File ( homedir + "\\" + dirName ) ) . mkdirs ( ) ; return homedir + "\\" + dirName + "\\" ; } else if ( isRunningMacOsX ( ) ) { ( new File ( homedir + "/Li...
Retrieves the path of the platform - dependent OpenXES support folder .
9,507
protected boolean processActionOverride ( HttpServletRequest request , HttpServletResponse response ) throws IOException , ServletException { PageFlowRequestWrapper wrapper = PageFlowRequestWrapper . get ( request ) ; if ( ! wrapper . isForwardedByButton ( ) && ! wrapper . isForwardedRequest ( ) ) { HttpServletRequest ...
The requested action can be overridden by a request parameter . In this case we parse the action from the request parameter and forward to a URI constructed from it .
9,508
protected boolean processPageFlowRequest ( HttpServletRequest request , HttpServletResponse response , String uri ) throws IOException , ServletException { if ( FileUtils . osSensitiveEndsWith ( uri , PageFlowConstants . PAGEFLOW_EXTENSION ) ) { String modulePath = PageFlowUtils . getModulePath ( request ) ; if ( ! mod...
Process any direct request for a page flow by forwarding to its begin action .
9,509
protected HttpServletRequest processMultipart ( HttpServletRequest request ) { if ( ! "POST" . equalsIgnoreCase ( request . getMethod ( ) ) ) return request ; String contentType = request . getContentType ( ) ; if ( contentType != null && contentType . startsWith ( "multipart/form-data" ) ) { PageFlowRequestWrapper pag...
If this is a multipart request wrap it with a special wrapper . Otherwise return the request unchanged .
9,510
protected void initDefinitionsMapping ( ) throws ServletException { definitionsFactory = null ; TilesUtilImpl tilesUtil = TilesUtil . getTilesUtil ( ) ; if ( tilesUtil instanceof TilesUtilStrutsImpl ) { definitionsFactory = ( ( TilesUtilStrutsImpl ) tilesUtil ) . getDefinitionsFactory ( getServletContext ( ) , moduleCo...
Read component instance mapping configuration file . This is where we read files properties .
9,511
protected void processNoCache ( HttpServletRequest request , HttpServletResponse response ) { boolean noCache = moduleConfig . getControllerConfig ( ) . getNocache ( ) ; if ( ! noCache ) { PageFlowConfig pfConfig = ConfigUtil . getConfig ( ) . getPageFlowConfig ( ) ; if ( pfConfig != null ) { PreventCache preventCache ...
Set the no - cache headers . This overrides the base Struts behavior to prevent caching even for the pages .
9,512
protected void prepareToAddChildNode ( ) throws IOException { if ( isOpen == false ) { throw new IOException ( "Attempting to write to a closed document!" ) ; } if ( lastChildNode != null ) { lastChildNode . close ( ) ; lastChildNode = null ; } writer . write ( "\n" ) ; }
Internal abstraction method ; prepares the document for inserting a new child tag of any type .
9,513
public static ServiceFactory newInstance ( ) throws ServiceException { if ( factory == null ) { PrivilegedAction action = new PropertyAccessAction ( SERVICEFACTORY_PROPERTY , DEFAULT_SERVICE_FACTORY ) ; String factoryName = ( String ) AccessController . doPrivileged ( action ) ; ClassLoader loader = Thread . currentThr...
Gets an instance of the ServiceFactory Only one copy of a factory exists and is returned to the application each time this method is called .
9,514
public void setHandlerConfig ( Map config ) { configMap . clear ( ) ; if ( config != null ) configMap . putAll ( config ) ; }
Sets the Handler configuration as java . util . Map
9,515
public static boolean isLegacyJavaScript ( ) { if ( javascriptMode == - 1 ) { setLegacyJavaScriptMode ( ) ; } assert ( javascriptMode != - 1 ) ; return ( javascriptMode == IdJavascript . INT_LEGACY || javascriptMode == IdJavascript . INT_LEGACY_ONLY ) ; }
Return true if the legacy JavaScript support should be written to the output stream .
9,516
public static boolean isDefaultJavaScript ( ) { if ( javascriptMode == - 1 ) { setLegacyJavaScriptMode ( ) ; } assert ( javascriptMode != - 1 ) ; return ( javascriptMode == IdJavascript . INT_DEFAULT || javascriptMode == IdJavascript . INT_LEGACY ) ; }
Return true if the default JavaScript support should be written to the output stream .
9,517
private static void setLegacyJavaScriptMode ( ) { JspTagConfig tagConfig = ConfigUtil . getConfig ( ) . getJspTagConfig ( ) ; if ( tagConfig != null ) { javascriptMode = tagConfig . getIdJavascript ( ) . getValue ( ) ; } else { javascriptMode = IdJavascript . INT_DEFAULT ; } }
This will set the JavaScript support level for the id and name attributes .
9,518
public int doEndTag ( ) throws JspException { if ( hasErrors ( ) ) return reportAndExit ( EVAL_PAGE ) ; HttpServletRequest req = ( HttpServletRequest ) pageContext . getRequest ( ) ; WriteRenderAppender writer = new WriteRenderAppender ( pageContext ) ; TagRenderingBase trb = TagRenderingBase . Factory . getRendering (...
Render the image and hyperlink .
9,519
public int doStartTag ( ) throws JspException { Tag parent = getParent ( ) ; if ( parent != null ) { String s = Bundle . getString ( "TempExcp_ContainedTemplate" ) ; registerTagError ( s , null ) ; reportErrors ( ) ; _fatalError = true ; return SKIP_BODY ; } ServletRequest req = pageContext . getRequest ( ) ; _savedCon...
the tag extension lifecycle method called when the tag is first encountered . This will cause the body of the tag to be evaluated .
9,520
protected void localRelease ( ) { super . localRelease ( ) ; _fatalError = false ; _templatePage = null ; _innerErrors = null ; _reportErrors = false ; _savedContext = null ; }
Reset all of the fields of the tag .
9,521
public static String convertCharsToXml ( String input ) { StringBuffer result = new StringBuffer ( ) ; for ( int i = 0 ; i < input . length ( ) ; i ++ ) { switch ( input . charAt ( i ) ) { case '<' : result . append ( "&lt;" ) ; break ; case '>' : result . append ( "&gt;" ) ; break ; case '"' : result . append ( "&quot...
Convenience method to convert XML reserved chars .
9,522
public static String convertCharsFromXml ( String input ) { StringBuffer result = new StringBuffer ( ) ; for ( int i = 0 ; i < input . length ( ) ; ) { if ( input . charAt ( i ) == '&' ) { if ( input . substring ( i , i + 3 ) . equals ( "&lt;" ) ) { result . append ( '<' ) ; i += 4 ; } else if ( input . substring ( i ,...
Convenience method for backward conversion of XML encoded chars .
9,523
public AjaxUrlInfo getAjaxUrl ( ServletContext servletContext , ServletRequest request , Object nameable ) { HttpServletRequest req = ( HttpServletRequest ) request ; String name = null ; if ( nameable instanceof INameable ) name = ( ( INameable ) nameable ) . getObjectName ( ) ; String path = req . getServletPath ( ) ...
This method will get the prefix for all URLs that are used for AJAX processing
9,524
protected void addModelReference ( XAttributable object , SXTag target ) throws IOException { XAttributeLiteral modelRefAttr = ( XAttributeLiteral ) object . getAttributes ( ) . get ( XSemanticExtension . KEY_MODELREFERENCE ) ; if ( modelRefAttr != null ) { target . addAttribute ( "modelReference" , modelRefAttr . getV...
Helper method adds all model references of an attributable to the given tag .
9,525
public boolean isOWL2DLOntologyID ( ) { return ! ontologyIRI . isPresent ( ) || ! ontologyIRI . get ( ) . isReservedVocabulary ( ) && ( ! versionIRI . isPresent ( ) || ! versionIRI . get ( ) . isReservedVocabulary ( ) ) ; }
Determines if this is a valid OWL 2 DL ontology ID . To be a valid OWL 2 DL ID the ontology IRI and version IRI must not be reserved vocabulary .
9,526
public String ensureValidExpression ( String dataSource , String attrName , String errorId ) throws JspException { try { boolean isExpr = isExpression ( dataSource ) ; if ( ! isExpr && containsExpression ( dataSource ) ) { String s = Bundle . getString ( errorId , new Object [ ] { dataSource } ) ; _tag . registerTagErr...
Ensure that the passed in data source is a valid expression .
9,527
private Object evaluateExpressionInternal ( String expression , String attrName , PageContext pageContext ) throws JspException { if ( logger . isDebugEnabled ( ) ) logger . debug ( "evaluate expression=\"" + expression + "\"" ) ; Object result = null ; try { VariableResolver vr = ImplicitObjectUtil . getReadVariableRe...
This is the real implementation of evaluateExpression .
9,528
public static String getModulePath ( HttpServletRequest request , String requestURI ) { return getModulePathForRelativeURI ( getRelativeURI ( request , requestURI , null ) ) ; }
Get the Struts module path for a URI . This is the parent directory relative to the web application root of the file referenced by the URI .
9,529
public static String getModulePathForRelativeURI ( String uri ) { if ( uri == null ) return null ; assert uri . length ( ) > 0 ; assert uri . charAt ( 0 ) == '/' : uri ; int slash = uri . lastIndexOf ( '/' ) ; uri = uri . substring ( 0 , slash ) ; return uri ; }
Get the Struts module path for a URI that is relative to the web application root .
9,530
public static String getRelativeURI ( HttpServletRequest request , PageFlowController relativeTo ) { if ( relativeTo == null ) return InternalUtils . getDecodedServletPath ( request ) ; return getRelativeURI ( request , InternalUtils . getDecodedURI ( request ) , relativeTo ) ; }
Get the request URI relative to the URI of the given PageFlowController .
9,531
public static String getRelativeURI ( HttpServletRequest request , String uri , PageFlowController relativeTo ) { String contextPath = request . getContextPath ( ) ; if ( relativeTo != null ) contextPath += relativeTo . getModulePath ( ) ; int overlap = uri . indexOf ( contextPath + '/' ) ; if ( overlap == - 1 ) return...
Get a URI relative to the URI of the given PageFlowController .
9,532
public static String getBeginActionURI ( String requestURI ) { InternalStringBuilder retVal = new InternalStringBuilder ( ) ; int lastSlash = requestURI . lastIndexOf ( '/' ) ; if ( lastSlash != - 1 ) { retVal . append ( requestURI . substring ( 0 , lastSlash ) ) ; } retVal . append ( '/' ) . append ( BEGIN_ACTION_NAME...
Get a URI for the begin action in the PageFlowController associated with the given request URI .
9,533
public static SharedFlowController getSharedFlow ( String sharedFlowClassName , HttpServletRequest request , ServletContext servletContext ) { StorageHandler sh = Handlers . get ( servletContext ) . getStorageHandler ( ) ; HttpServletRequest unwrappedRequest = unwrapMultipart ( request ) ; RequestContext rc = new Reque...
Get the shared flow with the given class name .
9,534
public static String getFormBeanName ( ActionForm formInstance , HttpServletRequest request ) { return getFormBeanName ( formInstance . getClass ( ) , request ) ; }
Get the name for the type of a ActionForm instance . Use a name looked up from the current Struts module or if none is found create one .
9,535
public static String getFormBeanName ( Class formBeanClass , HttpServletRequest request ) { ModuleConfig moduleConfig = RequestUtils . getRequestModuleConfig ( request ) ; List names = getFormNamesFromModuleConfig ( formBeanClass . getName ( ) , moduleConfig ) ; if ( names != null ) { assert names . size ( ) > 0 ; retu...
Get the name for an ActionForm type . Use a name looked up from the current Struts module or if none is found create one .
9,536
private static String generateFormBeanName ( Class formBeanClass , HttpServletRequest request ) { ModuleConfig moduleConfig = RequestUtils . getRequestModuleConfig ( request ) ; String formBeanClassName = formBeanClass . getName ( ) ; String formType = formBeanClassName ; int lastQualifier = formType . lastIndexOf ( '$...
Create the name for a form bean type .
9,537
public static Object getActionOutput ( String name , ServletRequest request ) { Map map = InternalUtils . getActionOutputMap ( request , false ) ; return map != null ? map . get ( name ) : null ; }
Get a named action output that was registered in the current request .
9,538
public static String getRewrittenActionURI ( ServletContext servletContext , HttpServletRequest request , HttpServletResponse response , String actionName , Map params , String fragment , boolean forXML ) throws URISyntaxException { MutableURI uri = getActionURI ( servletContext , request , response , actionName ) ; if...
Create a fully - rewritten URI given an action name and parameters .
9,539
public static boolean needsToBeSecure ( ServletContext context , ServletRequest request , String uri , boolean stripContextPath ) { String secureCheck = uri ; if ( stripContextPath ) { String contextPath = ( ( HttpServletRequest ) request ) . getContextPath ( ) ; if ( secureCheck . startsWith ( contextPath ) ) { secure...
Tell whether a given URI should be written to be secure .
9,540
public static String getURLTemplateKey ( URLType urlType , boolean needsToBeSecure ) { String key = URLTemplatesFactory . ACTION_TEMPLATE ; if ( urlType . equals ( URLType . ACTION ) ) { if ( needsToBeSecure ) { key = URLTemplatesFactory . SECURE_ACTION_TEMPLATE ; } else { key = URLTemplatesFactory . ACTION_TEMPLATE ; ...
Returns a key for the URL template type given the URL type and a flag indicating a secure URL or not .
9,541
@ SuppressWarnings ( "unchecked" ) public void mousePressed ( MouseEvent e ) { if ( checkModifiers ( e ) ) { final VisualizationViewer < String , String > vv = ( VisualizationViewer < String , String > ) e . getSource ( ) ; final Point2D p = e . getPoint ( ) ; GraphElementAccessor < String , String > pickSupport = vv ....
If the mouse is pressed in an empty area create a new vertex there . If the mouse is pressed on an existing vertex prepare to create an edge from that vertex to another
9,542
@ SuppressWarnings ( "unchecked" ) public void mouseReleased ( MouseEvent e ) { if ( checkModifiers ( e ) ) { final VisualizationViewer < String , String > vv = ( VisualizationViewer < String , String > ) e . getSource ( ) ; final Point2D p = e . getPoint ( ) ; Layout < String , String > layout = vv . getModel ( ) . ge...
If startVertex is non - null and the mouse is released over an existing vertex create an undirected edge from startVertex to the vertex under the mouse pointer . If shift was also pressed create a directed edge instead .
9,543
@ SuppressWarnings ( "unchecked" ) public void mouseDragged ( MouseEvent e ) { if ( checkModifiers ( e ) ) { if ( startVertex != null ) { transformEdgeShape ( down , e . getPoint ( ) ) ; transformArrowShape ( down , e . getPoint ( ) ) ; } VisualizationViewer < String , String > vv = ( VisualizationViewer < String , Str...
If startVertex is non - null stretch an edge shape between startVertex and the mouse pointer to simulate edge creation
9,544
private void transformEdgeShape ( Point2D down , Point2D out ) { float x1 = ( float ) down . getX ( ) ; float y1 = ( float ) down . getY ( ) ; float x2 = ( float ) out . getX ( ) ; float y2 = ( float ) out . getY ( ) ; AffineTransform xform = AffineTransform . getTranslateInstance ( x1 , y1 ) ; float dx = x2 - x1 ; flo...
code lifted from PluggableRenderer to move an edge shape into an arbitrary position
9,545
public void init ( ServletRequest request ) { String [ ] vals = request . getParameterValues ( ITEM_PARAM ) ; if ( vals != null ) { _retrieveMap = new HashMap ( ) ; for ( int i = 0 ; i < vals . length ; i ++ ) { String val = vals [ i ] ; int delimPos = val . indexOf ( DELIM ) ; if ( delimPos != - 1 ) { String expressio...
Initialize based on request parameters we re looking for .
9,546
public static void write ( LogView logView , String path ) throws IOException { String xml = xstream . toXML ( logView ) ; try ( BufferedWriter out = new BufferedWriter ( new FileWriter ( path ) ) ) { out . write ( xml ) ; } }
Serializes the log view under the given path .
9,547
public int insertOrdered ( XEvent event ) { try { return events . insertOrdered ( event ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; return - 1 ; } }
Insert the event in an ordered manner if timestamp information is available in this trace .
9,548
public < T extends ControlBean > T instantiate ( Class < T > beanClass , PropertyMap props , ControlBeanContext context , String id ) { String beanClassName = beanClass . getName ( ) ; String extImplBinding = _extImplBindings . getProperty ( beanClassName + "_" + id ) ; if ( extImplBinding == null ) extImplBinding = _e...
Instantiates a new ControlBean of the requested class using mechanisms provided by a provider - specific JavaBeans framework .
9,549
public static void checkReflectionParameters ( SqlFragmentContainer statement , MethodDeclaration methodDecl ) { ArrayList < ParameterDeclaration > params = new ArrayList < ParameterDeclaration > ( methodDecl . getParameters ( ) ) ; HashMap < String , ParameterDeclaration > paramMap = new HashMap < String , ParameterDe...
Verify that all reflection parameters in the statement element can be mapped to method parameters .
9,550
private static void doCheck ( SqlFragmentContainer statement , HashMap < String , ParameterDeclaration > paramMap , final MethodDeclaration method ) { SqlFragment [ ] fragments = statement . getChildren ( ) ; for ( SqlFragment fragment : fragments ) { if ( fragment instanceof SqlFragmentContainer ) { doCheck ( ( SqlFra...
Walk the tree of children of the statement process all children of type ReflectionFragment .
9,551
private static String buildMessage ( String parameterName , String methodName ) { ResourceBundle rb = ResourceBundle . getBundle ( "org.apache.beehive.controls.system.jdbc.parser.strings" , Locale . getDefault ( ) ) ; String pattern = rb . getString ( "jdbccontrol.invalid.param" ) ; return MessageFormat . format ( patt...
Build the error message for this module .
9,552
public void setUserInfo ( String userInfo ) { _userInfo = null ; if ( userInfo != null && userInfo . length ( ) > 0 ) { _userInfo = userInfo ; } }
Sets the userInfo . Assumes this component is already escaped .
9,553
public void setHost ( String host ) { _host = null ; if ( host != null && host . length ( ) > 0 ) { boolean needBrackets = ( ( host . indexOf ( ':' ) >= 0 ) && ! host . startsWith ( "[" ) && ! host . endsWith ( "]" ) ) ; if ( needBrackets ) { _host = '[' + host + ']' ; } else { _host = host ; } _opaque = false ; setSch...
Sets the host .
9,554
public void setPort ( int port ) { assert ( port >= 0 && port <= 65535 ) || ( port == UNDEFINED_PORT ) : "Invalid port" ; if ( ( port > 65535 ) || ( port < 0 && port != UNDEFINED_PORT ) ) { throw new IllegalArgumentException ( "A port must be between 0 and 65535 or equal to " + UNDEFINED_PORT + "." ) ; } _port = port ;...
Sets the port .
9,555
public void setPath ( String path ) { if ( path == null ) { _path = null ; setQuery ( null ) ; setFragment ( null ) ; } else { _path = path ; _opaque = false ; setSchemeSpecificPart ( null ) ; } }
Sets the path . Assumes this component is already escaped .
9,556
public String getParameter ( String name ) { if ( _parameters == null || ! _parameters . hasParameters ( ) ) return null ; List parameters = _parameters . getParameterValues ( name ) ; if ( parameters != null && parameters . size ( ) > 0 ) return ( String ) parameters . get ( 0 ) ; else return null ; }
Returns the value of the parameter . If several values are associated with the given parameter name the first value is returned .
9,557
public List getParameters ( String name ) { if ( _parameters == null || ! _parameters . hasParameters ( ) ) return Collections . EMPTY_LIST ; else { List parameters = _parameters . getParameterValues ( name ) ; if ( parameters == null ) return Collections . EMPTY_LIST ; else return Collections . unmodifiableList ( para...
Returns the values of the given parameter .
9,558
public void removeParameter ( String name ) { if ( _parameters == null || ! _parameters . hasParameters ( ) ) return ; _parameters . removeParameter ( name ) ; }
Removes the given parameter .
9,559
public void setFragment ( String fragment ) { _fragment = null ; if ( fragment != null && fragment . length ( ) > 0 ) { _fragment = fragment ; } }
Sets the fragment .
9,560
public static String encode ( String url , String encoding ) { String encodedURL = null ; try { encodedURL = URLCodec . encode ( url , encoding ) ; } catch ( java . io . UnsupportedEncodingException e ) { try { encodedURL = URLCodec . encode ( url , DEFAULT_ENCODING ) ; } catch ( java . io . UnsupportedEncodingExceptio...
Convenience method to encode unencoded components of a URI .
9,561
protected static int indexFirstOf ( String s , String delims , int offset ) { if ( s == null || s . length ( ) == 0 ) { return - 1 ; } if ( delims == null || delims . length ( ) == 0 ) { return - 1 ; } if ( offset < 0 ) { offset = 0 ; } else if ( offset > s . length ( ) ) { return - 1 ; } int min = s . length ( ) ; cha...
Get the earliest index searching for the first occurrance of any one of the given delimiters .
9,562
public boolean canParse ( File file ) { for ( XParser parser : XParserRegistry . instance ( ) . getAvailable ( ) ) { if ( parser . canParse ( file ) ) { return true ; } } return false ; }
Checks whether the given file can be parsed by any parser .
9,563
public Collection < XLog > parse ( File file ) throws Exception { Collection < XLog > result = null ; for ( XParser parser : XParserRegistry . instance ( ) . getAvailable ( ) ) { if ( parser . canParse ( file ) ) { try { result = parser . parse ( file ) ; return result ; } catch ( Exception e ) { } } } throw new Except...
Attempts to parse a collection of XES models from the given file using all available parsers .
9,564
public int doStartTag ( ) throws JspException { ServletRequest req = pageContext . getRequest ( ) ; Template . TemplateContext tc = ( Template . TemplateContext ) req . getAttribute ( TEMPLATE_SECTIONS ) ; if ( tc == null ) { String s = Bundle . getString ( "Tags_TemplateContextMissing" ) ; logger . warn ( stripBold ( ...
Renders the content of the section into the template . Errors are reported inline within the template in development mode . If no sections are defined an error is reported . If a section is not defined and no default URL is provided an error is reported .
9,565
static String stripBold ( String in ) { String boldStart = "<b>" ; String boldEnd = "</b>" ; int pos = in . indexOf ( boldStart ) ; if ( pos == - 1 ) return in ; InternalStringBuilder sb = new InternalStringBuilder ( in . substring ( 0 , pos ) ) ; int fill = pos + boldStart . length ( ) ; pos = in . indexOf ( boldEnd ,...
This will strip any html out of a warning
9,566
public static < T extends Annotation > T getProxy ( Class < T > propertySet , PropertyMap propertyMap ) { assert propertySet != null && propertyMap != null ; if ( ! propertySet . isAnnotation ( ) ) throw new IllegalArgumentException ( propertySet + " is not an annotation type" ) ; return ( T ) Proxy . newProxyInstance ...
Creates a new proxy instance implementing the PropertySet interface and backed by the data from the property map .
9,567
protected boolean needsUniqueID ( ) { for ( AnnotationMirror annotMirror : _clientDecl . getAnnotationMirrors ( ) ) { String annotType = annotMirror . getAnnotationType ( ) . toString ( ) ; if ( annotType . equals ( "org.apache.beehive.netui.pageflow.annotations.Jpf.Controller" ) || annotType . equals ( "org.apache.bee...
Returns true if this type of client requires that nested controls have unique identifiers
9,568
public String getID ( AptControlField control ) { if ( ! needsUniqueID ( ) ) return "\"" + control . getName ( ) + "\"" ; return "client.getClass() + \"@\" + client.hashCode() + \"." + control . getClassName ( ) + "." + control . getName ( ) + "\"" ; }
Returns a unique ID for a control field
9,569
protected ArrayList < AptControlField > initControls ( ) { ArrayList < AptControlField > controls = new ArrayList < AptControlField > ( ) ; if ( _clientDecl == null || _clientDecl . getFields ( ) == null ) return controls ; Collection < FieldDeclaration > declaredFields = _clientDecl . getFields ( ) ; for ( FieldDeclar...
Initializes the list of ControlFields declared directly by this ControlClient
9,570
public String getSuperClientName ( ) { ClassType superType = _clientDecl . getSuperclass ( ) ; while ( superType != null ) { ClassDeclaration superDecl = superType . getDeclaration ( ) ; Collection < FieldDeclaration > declaredFields = superDecl . getFields ( ) ; for ( FieldDeclaration fieldDecl : declaredFields ) { if...
Returns the fully qualified classname of the closest control client in the inheritance chain .
9,571
private void enforceVersionRequired ( FieldDeclaration f , InterfaceDeclaration controlIntf ) { VersionRequired versionRequired = f . getAnnotation ( VersionRequired . class ) ; Version versionPresent = controlIntf . getAnnotation ( Version . class ) ; if ( versionRequired != null ) { int majorRequired = - 1 ; try { ma...
Enforces the VersionRequired annotation for control fields .
9,572
protected Method getExceptionHandlerMethod ( FlowControllerHandlerContext context , String methodName , Throwable ex , Object formBean ) { FlowController flowController = context . getFlowController ( ) ; String cacheKey = methodName + '/' + ex . getClass ( ) . getName ( ) ; ClassLevelCache cache = ClassLevelCache . ge...
Get an Exception handler method .
9,573
public synchronized void alertSoftCopies ( ) throws IOException { NikeFS2LazyRandomAccessStorageImpl [ ] copies = softCopies . toArray ( new NikeFS2LazyRandomAccessStorageImpl [ softCopies . size ( ) ] ) ; for ( NikeFS2LazyRandomAccessStorageImpl copy : copies ) { if ( copy . isSoftCopy ) { copy . consolidateSoftCopy (...
This method alerts all child soft copies of this storage to consolidate ; called prior to modification of this instance . The child soft copies so alerted will detach from this instance consequently .
9,574
public synchronized void consolidateSoftCopy ( ) throws IOException { if ( isSoftCopy == true ) { ArrayList < NikeFS2Block > copyBlocks = new ArrayList < NikeFS2Block > ( ) ; if ( blocks . size ( ) > 0 ) { byte [ ] buffer = new byte [ blocks . get ( 0 ) . size ( ) ] ; for ( NikeFS2Block block : blocks ) { NikeFS2Block ...
Consolidates this soft copy prior to modification . This will detach this instance from its parent creating a true copy of its current data .
9,575
public boolean hasNext ( ) { if ( _primed ) { return true ; } try { _primed = _rs . next ( ) ; } catch ( SQLException sqle ) { return false ; } return _primed ; }
Does this iterater have more elements?
9,576
public Object next ( ) { try { if ( ! _primed ) { _primed = _rs . next ( ) ; if ( ! _primed ) { throw new NoSuchElementException ( ) ; } } _primed = false ; return _rowMapper . mapRowToReturnType ( ) ; } catch ( SQLException e ) { NoSuchElementException xNoSuch = new NoSuchElementException ( "ResultSet exception: " + e...
Get the next element in the iteration .
9,577
public static ControlContainerContext getContext ( ) { Stack < ControlContainerContext > contextStack = _threadContexts . get ( ) ; if ( contextStack == null || contextStack . size ( ) == 0 ) return null ; return contextStack . peek ( ) ; }
Returns the active ControlContainerContext for the current thread or null if no context is currently active .
9,578
public static void beginContext ( ControlContainerContext context ) { Stack < ControlContainerContext > contextStack = _threadContexts . get ( ) ; if ( contextStack == null ) { contextStack = new Stack < ControlContainerContext > ( ) ; _threadContexts . set ( contextStack ) ; } contextStack . push ( context ) ; }
Defines the beginning of a new control container execution context .
9,579
public static void endContext ( ControlContainerContext context ) { Stack < ControlContainerContext > contextStack = _threadContexts . get ( ) ; if ( contextStack == null || contextStack . size ( ) == 0 ) throw new IllegalStateException ( "No context started for current thread" ) ; if ( contextStack . peek ( ) != conte...
Ends the current control container execution context
9,580
public static synchronized DataUsageExtension instance ( ) { if ( SINGLETON == null ) { SINGLETON = new DataUsageExtension ( ) ; XFactory factory = XFactoryRegistry . instance ( ) . currentDefault ( ) ; ATTR_DATA = factory . createAttributeLiteral ( KEY_DATA , "" , SINGLETON ) ; SINGLETON . eventAttributes . add ( ( XA...
Provides access to the singleton instance of this extension .
9,581
public String extractData ( XEvent event ) { XAttribute attribute = event . getAttributes ( ) . get ( KEY_DATA ) ; if ( attribute == null ) { return null ; } else { return ( ( XAttributeLiteral ) attribute ) . getValue ( ) ; } }
Extracts the data attribute string from an event .
9,582
public void assignData ( XEvent event , String data ) { if ( data != null && data . trim ( ) . length ( ) > 0 ) { XAttributeLiteral attr = ( XAttributeLiteral ) ATTR_DATA . clone ( ) ; attr . setValue ( data . trim ( ) ) ; event . getAttributes ( ) . put ( KEY_DATA , attr ) ; } }
Assigns the data attribute value for a given event .
9,583
protected AptControlInterface initControlInterface ( ) { TypeMirror fieldType = _fieldDecl . getType ( ) ; if ( ! ( fieldType instanceof InterfaceType ) ) { _ap . printError ( _fieldDecl , "context.field.badinterface" ) ; return null ; } return new AptControlInterface ( ( ( InterfaceType ) _fieldDecl . getType ( ) ) . ...
Initializes a ControlInterface associated with this context field . Because contextual services can expose both APIs and events they are similar to controls .
9,584
public static String encode ( final String decoded , final String charset ) throws UnsupportedEncodingException { return s_codec . encode ( decoded , charset ) ; }
URL encodes a string .
9,585
public static String encode ( final String decoded ) { try { return s_codec . encode ( decoded ) ; } catch ( EncoderException e ) { throw new IllegalStateException ( Bundle . getErrorString ( "URLCodec_encodeException" , new String [ ] { e . getMessage ( ) } ) , e ) ; } }
URL encodes a string using the default character set
9,586
public static String decode ( final String encoded , final String charset ) throws UnsupportedEncodingException { try { return s_codec . decode ( encoded , charset ) ; } catch ( DecoderException e ) { throw new IllegalStateException ( Bundle . getErrorString ( "URLCodec_decodeException" , new String [ ] { e . getMessag...
URL decodes a string .
9,587
private NameGenerator getNameGenerator ( String namePrefix ) { synchronized ( this ) { if ( _nameGenerators == null ) _nameGenerators = new HashMap < String , NameGenerator > ( ) ; NameGenerator nameGenerator = _nameGenerators . get ( namePrefix ) ; if ( nameGenerator == null ) { nameGenerator = new NameGenerator ( nam...
Returns a new NameGenerator instance based upon a particular naming prefix .
9,588
public String generateUniqueID ( Class clazz ) { String namePrefix = clazz . getName ( ) ; int dotIndex = namePrefix . lastIndexOf ( '.' ) ; if ( dotIndex > 0 ) namePrefix = namePrefix . substring ( dotIndex + 1 ) ; NameGenerator nameGenerator = getNameGenerator ( namePrefix ) ; return nameGenerator . next ( ) ; }
Generates a new unique control ID for an instance of the target class
9,589
public ControlBean getBean ( String id ) { int delim = id . indexOf ( org . apache . beehive . controls . api . bean . ControlBean . IDSeparator ) ; if ( delim < 0 ) return ( ControlBean ) _childMap . get ( id ) ; ControlBean bean = ( ControlBean ) _childMap . get ( id . substring ( 0 , delim ) ) ; if ( bean == null ) ...
Returns a ControlBean instance nested the current BeanContext .
9,590
protected PropertyMap getBeanAnnotationMap ( ControlBean bean , AnnotatedElement annotElem ) { PropertyMap map = new AnnotatedElementMap ( annotElem ) ; if ( bean != null ) setDelegateMap ( map , bean , annotElem ) ; return map ; }
The default implementation of getBeanAnnotationMap . This returns a map based purely upon annotation reflection
9,591
public int doEndTag ( ) throws JspException { HttpServletRequest request = ( HttpServletRequest ) pageContext . getRequest ( ) ; HttpServletResponse response = ( HttpServletResponse ) pageContext . getResponse ( ) ; ServletContext context = pageContext . getServletContext ( ) ; try { boolean encoded = false ; UrlConfig...
Render the end of the rewriteURL tag .
9,592
private List getFormBeanNames ( TypeDeclaration beanType ) { List formBeans = _strutsApp . getMatchingFormBeans ( beanType , null ) ; List formBeanNames = new ArrayList ( ) ; for ( Iterator i = formBeans . iterator ( ) ; i . hasNext ( ) ; ) { FormBeanModel formBeanModel = ( FormBeanModel ) i . next ( ) ; formBeanNames ...
Returns a list of String names .
9,593
private void addFieldRules ( AnnotationInstance rulesContainerAnnotation , RuleInfo ruleInfo , boolean applyToAllLocales ) { Locale locale = null ; if ( ! applyToAllLocales ) { String language = CompilerUtils . getString ( rulesContainerAnnotation , LANGUAGE_ATTR , true ) ; if ( language != null ) { String country = Co...
Add field rules from either a Jpf . ValidationField or a Jpf . ValidationLocaleRules annotation .
9,594
private final String prefix ( String style ) { InternalStringBuilder sb = new InternalStringBuilder ( 16 ) ; sb . append ( _stylePrefix ) ; if ( style != null ) { sb . append ( DELIM ) ; sb . append ( style ) ; } return sb . toString ( ) ; }
Utility method to concatenate the given style class name and the style prefix .
9,595
public void setDispatchMode ( DispatchMode argMode ) { if ( argMode == null ) { argMode = DispatchMode . SINGLE_THREAD ; } if ( argMode == DispatchMode . SINGLE_THREAD ) { startBackgroundThread ( ) ; } mode = argMode ; }
Sets the dispatch mode
9,596
public synchronized void makeCustomRequest ( AnalyticsRequestData argData ) { if ( ! enabled ) { logger . debug ( "Ignoring tracking request, enabled is false" ) ; return ; } if ( argData == null ) { throw new NullPointerException ( "Data cannot be null" ) ; } if ( builder == null ) { throw new NullPointerException ( "...
Makes a custom tracking request based from the given data .
9,597
private synchronized static void startBackgroundThread ( ) { if ( backgroundThread == null ) { backgroundThreadMayRun = true ; backgroundThread = new Thread ( asyncThreadGroup , "AnalyticsBackgroundThread" ) { public void run ( ) { logger . debug ( "AnalyticsBackgroundThread started" ) ; while ( backgroundThreadMayRun ...
If the background thread for queued mode is not running start it now .
9,598
public void lock ( ) { boolean wasInterrupted = false ; while ( true ) { try { impl . lockInterruptibly ( ) ; if ( wasInterrupted ) { Thread . currentThread ( ) . interrupt ( ) ; } return ; } catch ( InterruptedException e ) { wasInterrupted = true ; } } }
Acquires the lock .
9,599
public void setContext ( AdapterContext context ) { Object servletContext = context . getExternalContext ( ) ; assert servletContext instanceof ServletContext : servletContext ; _servletContext = ( ServletContext ) servletContext ; _eventReporter = createEventReporter ( ) ; }
Set the AdapterContext .