idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
9,600
public InputSource resolveEntity ( String publicID , String systemID ) throws SAXException , IOException { InputSource localFileInput = resolveLocalEntity ( systemID ) ; return localFileInput != null ? localFileInput : new InputSource ( systemID ) ; }
Resolve the entity . First try to find it locally then fallback to the network .
9,601
public InputSource resolveLocalEntity ( String systemID ) throws SAXException , IOException { String localFileName = systemID ; int fileNameStart = localFileName . lastIndexOf ( '/' ) + 1 ; if ( fileNameStart < localFileName . length ( ) ) { localFileName = systemID . substring ( fileNameStart ) ; } ClassLoader cl = Lo...
Resolve the given entity locally .
9,602
public static AsyncHttpClient createClient ( Configuration configuration , int numberOfHostsBeingConnectedTo ) { AsyncHttpClientConfig . Builder cf = createClientConfig ( configuration ) ; cf . setMaximumConnectionsTotal ( - 1 ) ; cf . setMaximumConnectionsPerHost ( - 1 ) ; cf . setExecutorService ( getExecutorService ...
Creates a AsyncHttpClient object that can be used for talking to elasticsearch
9,603
protected String getPreparedStatementText ( ControlBeanContext context , Method m , Object [ ] args ) { Object val = getParameterValue ( context , m , args ) ; if ( val instanceof JdbcControl . ComplexSqlFragment ) { return ( ( JdbcControl . ComplexSqlFragment ) val ) . getSQL ( ) ; } else { return PREPARED_STATEMENT_S...
Return text generated by this fragment for a PreparedStatement
9,604
protected boolean hasComplexValue ( ControlBeanContext context , Method m , Object [ ] args ) { Object val = getParameterValue ( context , m , args ) ; return val instanceof JdbcControl . ComplexSqlFragment ; }
A reflection fragment may evaluate to an JdbcControl . ComplexSqlFragment type which requires additional steps to evaluate after reflection .
9,605
protected String [ ] getParameterNameQualifiers ( ) { String [ ] nameQualifiersCopy = new String [ _nameQualifiers . length ] ; System . arraycopy ( _nameQualifiers , 0 , nameQualifiersCopy , 0 , _nameQualifiers . length ) ; return nameQualifiersCopy ; }
Get a copy of the array of parameter name qualifiers .
9,606
protected Object [ ] getParameterValues ( ControlBeanContext context , Method method , Object [ ] args ) { Object value = getParameterValue ( context , method , args ) ; if ( value instanceof JdbcControl . ComplexSqlFragment ) { JdbcControl . SQLParameter [ ] params = ( ( JdbcControl . ComplexSqlFragment ) value ) . ge...
Get the value of this parameter .
9,607
private Object getParameterValue ( ControlBeanContext context , Method method , Object [ ] args ) { Object value ; try { value = context . getParameterValue ( method , _nameQualifiers [ 0 ] , args ) ; } catch ( IllegalArgumentException iae ) { throw new ControlException ( "Invalid argument name in SQL statement: " + _n...
Get the value from the method param .
9,608
private Object extractValue ( Object aValue , String aName , String bName ) { Class aClass = aValue . getClass ( ) ; Object value ; String bNameCapped = Character . toUpperCase ( bName . charAt ( 0 ) ) + bName . substring ( 1 ) ; Method getMethod = null ; Class retType ; try { getMethod = aClass . getMethod ( "is" + bN...
Get the value from the referenced method parameter using java reflection
9,609
protected boolean isPrivateMethod ( MethodDeclaration md ) { Collection < Modifier > modifiers = md . getModifiers ( ) ; for ( Modifier m : modifiers ) { if ( m . compareTo ( Modifier . PRIVATE ) == 0 ) return true ; } return false ; }
Checks a MethodDeclaration for a private modifier .
9,610
private String getFormalTypeParameters ( boolean namesOnly ) { Collection < TypeParameterDeclaration > ftColl = _typeDecl . getFormalTypeParameters ( ) ; if ( ftColl . size ( ) == 0 ) return "" ; StringBuffer sb = new StringBuffer ( "<" ) ; boolean isFirst = true ; for ( TypeParameterDeclaration tpDecl : ftColl ) { if ...
Helper method to return type parameter information
9,611
public boolean removeDataAttribute ( DataAttribute attribute ) throws LockingException { if ( isFieldLocked ( EntryField . DATA ) ) { if ( dataUsage . containsKey ( attribute ) ) { throw new LockingException ( EntryField . DATA ) ; } return false ; } else { return dataUsage . remove ( attribute ) != null ; } }
Removes the given attribute from the set of managed attributes .
9,612
public boolean setDataUsage ( Map < DataAttribute , Set < DataUsage > > dataUsage ) throws ParameterException , LockingException { Validate . notNull ( dataUsage ) ; Validate . notEmpty ( dataUsage . keySet ( ) ) ; Validate . noNullElements ( dataUsage . keySet ( ) ) ; Validate . noNullElements ( dataUsage . values ( )...
Sets the given data usage as data usage for this entry .
9,613
public boolean setDataUsageFor ( DataAttribute attribute , Set < DataUsage > dataUsage ) throws ParameterException , LockingException { Validate . notNull ( attribute ) ; Validate . notNull ( dataUsage ) ; Validate . notEmpty ( dataUsage ) ; if ( isFieldLocked ( EntryField . DATA ) ) { if ( ! ( this . dataUsage . conta...
Sets the data usage for a given attribute .
9,614
public boolean addDataUsage ( DataAttribute attribute , DataUsage usage ) throws ParameterException , LockingException { Validate . notNull ( attribute ) ; if ( isFieldLocked ( EntryField . DATA ) ) { if ( ! dataUsage . containsKey ( attribute ) ) { throw new LockingException ( EntryField . DATA ) ; } return false ; } ...
Adds the given attribute to the list of attributes
9,615
public void add ( T method ) { if ( isOverrideMethod ( method ) ) { return ; } _methods . put ( method . getName ( ) + method . getArgTypes ( ) , method ) ; Object nameValue = _nameMap . get ( method . getName ( ) ) ; if ( nameValue == null ) { _nameMap . put ( method . getName ( ) , method ) ; } else { int nextIndex ;...
Adds a new method to the list . Also detects overloaded methods and ensures that they will receive a unique index value .
9,616
protected void setMapClass ( Class mapClass ) { if ( ControlBean . class . isAssignableFrom ( mapClass ) ) { Class [ ] intfs = mapClass . getInterfaces ( ) ; for ( int i = 0 ; i < intfs . length ; i ++ ) { if ( intfs [ i ] . isAnnotationPresent ( ControlInterface . class ) || intfs [ i ] . isAnnotationPresent ( Control...
Sets the PropertySet or Control interface associated with this map . Only properties declared by the PropertySet or one of the PropertySets on the Control interface may be used with this map .
9,617
private boolean isCompatibleClass ( Class checkClass ) { if ( _mapClass . isAssignableFrom ( checkClass ) ) return true ; if ( checkClass . isAnnotationPresent ( PropertySet . class ) ) { Class declaringClass = checkClass . getDeclaringClass ( ) ; if ( declaringClass == null ) return true ; if ( declaringClass . isAssi...
Checks to see if the provided class is a control or property set interface that is compatible with the local PropertyMap .
9,618
public synchronized void setDelegateMap ( PropertyMap delegateMap ) { if ( ! isCompatibleClass ( delegateMap . getMapClass ( ) ) ) throw new IllegalArgumentException ( "The delegate map type (" + delegateMap . getMapClass ( ) + " is an incompatible type with " + _mapClass ) ; _delegateMap = delegateMap ; }
Sets a delegate base property map from which values will be derived if not found within the local property map .
9,619
public boolean containsPropertySet ( Class < ? extends Annotation > propertySet ) { if ( _delegateMap != null ) return _delegateMap . containsPropertySet ( propertySet ) ; return false ; }
Returns true if the PropertyMap contains one or more values for the specified PropertySet false otherwise .
9,620
public < T extends Annotation > T getPropertySet ( Class < T > propertySet ) { if ( ! containsPropertySet ( propertySet ) ) return null ; return PropertySetProxy . getProxy ( propertySet , this ) ; }
Returns a PropertySet proxy instance that derives its data from the contents of the property map . Will return null if the PropertyMap does not contain any properties associated with the specified PropertySet .
9,621
public void setProperty ( String name , String value , int propertyIndex ) { additionalProperties [ propertyIndex ] . setName ( name ) ; additionalProperties [ propertyIndex ] . setValue ( value ) ; }
Sets the property at the given index to the given name and value .
9,622
public synchronized boolean hasService ( Class serviceClass ) { ServiceProvider sp = _serviceProviders . get ( serviceClass ) ; if ( sp != null && ! sp . isRevoked ( ) ) { return true ; } BeanContext bc = getBeanContext ( ) ; if ( bc instanceof BeanContextServices ) { return ( ( BeanContextServices ) bc ) . hasService ...
Reports whether or not a given service is currently available from this context .
9,623
public Iterator getCurrentServiceClasses ( ) { ArrayList < Class > currentClasses = new ArrayList < Class > ( ) ; for ( Class serviceClass : _serviceProviders . keySet ( ) ) { ServiceProvider sp = _serviceProviders . get ( serviceClass ) ; if ( ! sp . isRevoked ( ) && ! sp . isDelegated ( ) ) { currentClasses . add ( s...
Gets the currently available services for this context .
9,624
protected synchronized void releaseBeanContextResources ( ) { for ( Class serviceClass : _serviceProviders . keySet ( ) ) { ServiceProvider sp = _serviceProviders . get ( serviceClass ) ; if ( sp . isDelegated ( ) ) { sp . revoke ( new BeanContextServiceRevokedEvent ( ( BeanContextServices ) getPeer ( ) , serviceClass ...
Invoked when all resources obtained from the current nested bean context need to be released . For BeanContextServices this means revoke any services obtained from a delegate services provider . Typically invoked when the parent context is changed .
9,625
protected void initialize ( ) { super . initialize ( ) ; _serviceProviders = Collections . synchronizedMap ( new HashMap < Class , ServiceProvider > ( ) ) ; _bcsListeners = Collections . synchronizedList ( new ArrayList < BeanContextServicesListener > ( ) ) ; }
Initialize data structures .
9,626
private Class findServiceClass ( Object service ) { for ( Class sc : _serviceProviders . keySet ( ) ) { if ( sc . isInstance ( service ) ) { return sc ; } } throw new IllegalArgumentException ( "Cannot find service provider for: " + service . getClass ( ) . getCanonicalName ( ) ) ; }
Try to find the registered service for a service object instance . May return null if the object instance is not from a service registered with this service provider .
9,627
private synchronized void readObject ( ObjectInputStream ois ) throws IOException , ClassNotFoundException { ois . defaultReadObject ( ) ; int svcsSize = ois . readInt ( ) ; for ( int i = 0 ; i < svcsSize ; i ++ ) { _serviceProviders . put ( ( Class ) ois . readObject ( ) , ( ServiceProvider ) ois . readObject ( ) ) ; ...
Deserialization support .
9,628
private synchronized void writeObject ( ObjectOutputStream oos ) throws IOException { int serializable = 0 ; oos . defaultWriteObject ( ) ; Set < Map . Entry < Class , ServiceProvider > > providers = _serviceProviders . entrySet ( ) ; for ( Map . Entry < Class , ServiceProvider > provider : providers ) { if ( provider ...
Serialize this instance including any serializable services and BeanContextServicesListeners . Any services or listeners which are not Serializable will not be present once deserialized .
9,629
public boolean isMatched ( String value , Boolean defaultValue ) { if ( value == null ) return false ; if ( _match != null ) { for ( int i = 0 ; i < _match . length ; i ++ ) { if ( value . equals ( _match [ i ] ) ) return true ; } } else { if ( defaultValue != null ) return defaultValue . booleanValue ( ) ; if ( _defau...
Checks whether the given value matches one of the CheckBoxGroup s selected CheckBoxOptions .
9,630
public int doStartTag ( ) throws JspException { ServletRequest req = pageContext . getRequest ( ) ; if ( _cr == null ) _cr = TagRenderingBase . Factory . getConstantRendering ( req ) ; Object val = evaluateDataSource ( ) ; _defaultSelections = ( List ) evaluateDefaultValue ( ) ; if ( hasErrors ( ) ) { return SKIP_BODY ...
Determine the set of matches for the CheckBoxGroup
9,631
private void buildMatch ( Object val ) { if ( val instanceof String [ ] ) { _match = ( String [ ] ) val ; } else { Iterator matchIterator = null ; matchIterator = IteratorFactory . createIterator ( val ) ; if ( matchIterator == null ) matchIterator = IteratorFactory . EMPTY_ITERATOR ; List matchList = new ArrayList ( )...
This method will build the match list should this be a hashmap?
9,632
public String getClassDeclaration ( ) { StringBuffer sb = new StringBuffer ( _shortName ) ; sb . append ( _controlIntf . getFormalTypeParameters ( ) ) ; return sb . toString ( ) ; }
Returns the class declaration for the ControlBean
9,633
public String getSuperTypeBinding ( ) { InterfaceType superType = _controlIntf . getSuperType ( ) ; if ( superType != null ) { String typeStr = superType . toString ( ) ; int paramIndex = typeStr . indexOf ( '<' ) ; if ( paramIndex > 0 ) return typeStr . substring ( paramIndex ) ; } return "" ; }
Returns any formal type parameters that should be bound for the bean s superclass based upon any type bindings that occur on the original interface .
9,634
private int processDivPanel ( ) throws JspException { if ( ! _visible ) return EVAL_PAGE ; if ( hasErrors ( ) ) { reportErrors ( ) ; localRelease ( ) ; return EVAL_PAGE ; } BodyContent bc = getBodyContent ( ) ; String content = ( bc != null ) ? bc . getString ( ) : "" ; ResponseUtils . write ( pageContext , content ) ;...
This method will process the section in the context of a DivPanel
9,635
private int processTemplate ( ) { ServletRequest req = pageContext . getRequest ( ) ; Template . TemplateContext tc = ( Template . TemplateContext ) req . getAttribute ( TEMPLATE_SECTIONS ) ; if ( tc . secs == null ) { tc . secs = new HashMap ( ) ; } assert ( tc . secs != null ) ; if ( ! _visible ) { tc . secs . put ( ...
This method will process the section in the context of the Template
9,636
public String getImageRoot ( ) { if ( _imageRoot != null ) return _imageRoot ; if ( _parent != null ) return _parent . getImageRoot ( ) ; return null ; }
Return the default location of all images . It is used as the location for the tree structure images .
9,637
private String getRealIconRoot ( ) { if ( _iconRoot != null ) return _iconRoot ; if ( _parent != null ) return _parent . getRealIconRoot ( ) ; return null ; }
This method will walk the inheritable state looking for an icon root . It returns null if not found .
9,638
public void initalizeTreeState ( ) { _lastNodeExpandedImage = IMAGE_NODE_EXPAND_LAST ; _nodeExpandedImage = IMAGE_NODE_EXPAND ; _lastNodeCollapsedImage = IMAGE_NODE_COLLAPSE_LAST ; _nodeCollapsedImage = IMAGE_NODE_COLLAPSE ; _lastLineJoinImage = IMAGE_LINE_JOIN_LAST ; _lineJoinImage = IMAGE_LINE_JOIN ; _verticalLineIma...
This method initalizes the state of the properties to their default values used by the tree tag to create the tree markup .
9,639
public void register ( XExtension extension ) { extensionMap . put ( extension . getUri ( ) , extension ) ; int i = extensionList . indexOf ( extension ) ; if ( i < 0 ) { extensionList . add ( extension ) ; } else { extensionList . remove ( i ) ; extensionList . add ( i , extension ) ; } }
Explicitly registers an extension instance with the extension manager .
9,640
public XExtension getByUri ( URI uri ) { XExtension extension = extensionMap . get ( uri ) ; if ( extension == null ) { try { extension = XExtensionParser . instance ( ) . parse ( uri ) ; register ( extension ) ; XLogging . log ( "Imported XES extension '" + extension . getUri ( ) + "' from remote source" , XLogging . ...
Retrieves an extension instance by its unique URI . If the extension has not been registered before it is looked up in the local cache . If it cannot be found in the cache the manager attempts to download it from its unique URI and add it to the set of managed extensions .
9,641
protected final void registerStandardExtensions ( ) { register ( XConceptExtension . instance ( ) ) ; register ( XTimeExtension . instance ( ) ) ; register ( XLifecycleExtension . instance ( ) ) ; register ( XOrganizationalExtension . instance ( ) ) ; register ( XSemanticExtension . instance ( ) ) ; }
Registers all defined standard extensions with the extension manager before caching .
9,642
protected void cacheExtension ( URI uri ) { String uriStr = uri . toString ( ) . toLowerCase ( ) ; if ( uriStr . endsWith ( "/" ) ) { uriStr = uriStr . substring ( 0 , uriStr . length ( ) - 1 ) ; } String fileName = uriStr . substring ( uriStr . lastIndexOf ( '/' ) ) ; if ( fileName . endsWith ( ".xesext" ) == false ) ...
Downloads and caches an extension from its remote definition file . The extension is subsequently placed in the local cache so that future loading is accelerated .
9,643
protected final void loadExtensionCache ( ) { long minModified = System . currentTimeMillis ( ) - MAX_CACHE_MILLIS ; File extFolder = XRuntimeUtils . getExtensionCacheFolder ( ) ; XExtension extension ; File [ ] extFiles = extFolder . listFiles ( ) ; if ( extFiles == null ) { XLogging . log ( "Extension caching disable...
Loads all extensions stored in the local cache . Cached extensions which exceed the maximum caching age are discarded and downloaded freshly .
9,644
public Object get ( String name , PageFlowContextActivator activator ) { assert ( name != null ) : "Parameter 'name' must not be null" ; assert ( activator != null ) : "Parameter 'activator' must not be null" ; Object ret = _contexts . get ( name ) ; if ( ret == null ) { ret = activator . activate ( ) ; _contexts . put...
This method will lookup a named object and return it . The object is looked up by name . If the object doesn t exist the activator object is called to create a new instance of the object before it is returned .
9,645
private void checkConditionalForwardsExpressions ( ClassDeclaration jclass ) throws FatalCompileTimeException { List simpleActions = CompilerUtils . getAnnotationArrayValue ( jclass , CONTROLLER_TAG_NAME , SIMPLE_ACTIONS_ATTR , true ) ; if ( simpleActions != null ) { HashSet expressionsFound = new HashSet ( ) ; for ( I...
Check for duplicate expressions in conditional forwards of the simple action annotations .
9,646
public ActionForm getFirstOutputForm ( HttpServletRequest request ) { if ( _outputForms == null || _outputForms . size ( ) == 0 ) { if ( _outputFormBeanType != null ) { try { if ( _log . isDebugEnabled ( ) ) { _log . debug ( "Creating form bean of type " + _outputFormBeanType ) ; } ServletContext servletContext = Inter...
Get the first output form bean that was added to this Forward .
9,647
protected ActionForward findForward ( String forwardName ) { ActionForward fwd = _mapping != null ? _mapping . findForward ( forwardName ) : null ; if ( fwd != null ) { return fwd ; } else if ( _altModuleConfig != null ) { return ( ActionForward ) _altModuleConfig . findForwardConfig ( forwardName ) ; } return null ; }
Resolves the forward with the given name from the stored ActionMapping if possible or from the stored alternate ModuleConfig as a last resort .
9,648
private void checkActionOutputs ( PageFlowActionForward fc ) { PageFlowActionForward . ActionOutput [ ] actionOutputs = fc . getActionOutputs ( ) ; boolean doExpensiveChecks = _actionOutputs != null && ! AdapterManager . getServletContainerAdapter ( _servletContext ) . isInProductionMode ( ) ; for ( int i = 0 ; i < act...
Make sure required action outputs are present and are of the right type ( only make the latter check when not in production mode
9,649
public static FilterTypeHint getTypeHint ( String hint ) { if ( STRING . getHint ( ) . equals ( hint ) ) return STRING ; else if ( NUMERIC . getHint ( ) . equals ( hint ) ) return NUMERIC ; else if ( DATE . getHint ( ) . equals ( hint ) ) return DATE ; else throw new IllegalArgumentException ( Bundle . getErrorString (...
Given a String lookup a FilterTypeHint for the String . Valid
9,650
public void setAttribute ( String name , String value , String facet ) throws JspException { if ( name != null ) { if ( name . equals ( DISABLED ) ) { setDisabled ( Boolean . parseBoolean ( value ) ) ; return ; } else if ( name . equals ( READONLY ) ) { _state . readonly = new Boolean ( value ) . booleanValue ( ) ; ret...
Base support for the attribute tag .
9,651
public int doEndTag ( ) throws JspException { ServletRequest req = pageContext . getRequest ( ) ; Object textObject = null ; Object val = evaluateDataSource ( ) ; textObject = ( val != null ) ? val : "" ; assert ( textObject != null ) ; ByRef ref = new ByRef ( ) ; nameHtmlControl ( _state , ref ) ; _state . disabled = ...
Render the TextArea .
9,652
public static URLTemplatesFactory getURLTemplatesFactory ( ServletContext servletContext ) { assert servletContext != null : "The ServletContext cannot be null." ; if ( servletContext == null ) { throw new IllegalArgumentException ( "The ServletContext cannot be null." ) ; } return ( URLTemplatesFactory ) servletContex...
Gets the URLTemplatesFactory instance from a ServletContext attribute .
9,653
public static void initServletContext ( ServletContext servletContext , URLTemplatesFactory templatesFactory ) { assert servletContext != null : "The ServletContext cannot be null." ; if ( servletContext == null ) { throw new IllegalArgumentException ( "The ServletContext cannot be null." ) ; } servletContext . setAttr...
Adds a given URLTemplatesFactory instance as an attribute on the ServletContext .
9,654
public static URLTemplatesFactory getURLTemplatesFactory ( ServletRequest servletRequest ) { assert servletRequest != null : "The ServletRequest cannot be null." ; if ( servletRequest == null ) { throw new IllegalArgumentException ( "The ServletRequest cannot be null." ) ; } return ( URLTemplatesFactory ) servletReques...
Gets the URLTemplatesFactory instance from a ServletRequest attribute .
9,655
public static void initServletRequest ( ServletRequest servletRequest , URLTemplatesFactory templatesFactory ) { assert servletRequest != null : "The ServletRequest cannot be null." ; if ( servletRequest == null ) { throw new IllegalArgumentException ( "The ServletRequest cannot be null." ) ; } servletRequest . setAttr...
Adds a given URLTemplatesFactory instance as an attribute on the ServletRequest .
9,656
public void reset ( Set < OWLEntity > toReturn ) { objects = toReturn ; if ( anonymousIndividuals != null ) { verifyNotNull ( anonymousIndividuals ) . clear ( ) ; } }
XXX not in the interface
9,657
private static Object getSessionVar ( HttpServletRequest request , ServletContext servletContext , String name ) { StorageHandler sh = Handlers . get ( servletContext ) . getStorageHandler ( ) ; HttpServletRequest unwrappedRequest = PageFlowUtils . unwrapMultipart ( request ) ; RequestContext rc = new RequestContext ( ...
This is a generic routine that will retrieve a value from the Session through the StorageHandler .
9,658
public static boolean isXMLNameStartCharacter ( int codePoint ) { return codePoint == ':' || codePoint >= 'A' && codePoint <= 'Z' || codePoint == '_' || codePoint >= 'a' && codePoint <= 'z' || codePoint >= 0xC0 && codePoint <= 0xD6 || codePoint >= 0xD8 && codePoint <= 0xF6 || codePoint >= 0xF8 && codePoint <= 0x2FF || ...
Determines if a character is an XML name start character .
9,659
public static boolean isXMLNameChar ( int codePoint ) { return isXMLNameStartCharacter ( codePoint ) || codePoint == '-' || codePoint == '.' || codePoint >= '0' && codePoint <= '9' || codePoint == 0xB7 || codePoint >= 0x0300 && codePoint <= 0x036F || codePoint >= 0x203F && codePoint <= 0x2040 ; }
Determines if a character is an XML name character .
9,660
public static int getNCNameSuffixIndex ( CharSequence s ) { if ( s . length ( ) > 1 && s . charAt ( 0 ) == '_' && s . charAt ( 1 ) == ':' ) { return - 1 ; } int index = - 1 ; for ( int i = s . length ( ) - 1 ; i > - 1 ; i -- ) { if ( ! Character . isLowSurrogate ( s . charAt ( i ) ) ) { int codePoint = Character . code...
Gets the index of the longest NCName that is the suffix of a character sequence .
9,661
public static String getNCNameSuffix ( CharSequence s ) { if ( s . length ( ) > 1 && s . charAt ( 0 ) == '_' && s . charAt ( 1 ) == ':' ) { return null ; } int localPartStartIndex = getNCNameSuffixIndex ( s ) ; if ( localPartStartIndex > - 1 ) { return s . toString ( ) . substring ( localPartStartIndex ) ; } else { ret...
Get the longest NCName that is a suffix of a character sequence .
9,662
public static String getNCNamePrefix ( CharSequence s ) { if ( s . length ( ) > 1 && s . charAt ( 0 ) == '_' && s . charAt ( 1 ) == ':' ) { return s . toString ( ) ; } int localPartStartIndex = getNCNameSuffixIndex ( s ) ; if ( localPartStartIndex > - 1 ) { return s . toString ( ) . substring ( 0 , localPartStartIndex ...
utility to get the part of a charsequence that is not the NCName fragment .
9,663
public static String escapeXML ( CharSequence s ) { StringBuilder sb = new StringBuilder ( s . length ( ) * 2 ) ; for ( int i = 0 ; i < s . length ( ) ; ) { int codePoint = Character . codePointAt ( s , i ) ; if ( codePoint == '<' ) { sb . append ( LT ) ; } else if ( codePoint == '>' ) { sb . append ( GT ) ; } else if ...
Escapes a character sequence so that it is valid XML .
9,664
public static StringBuilder escapeXML ( char [ ] chars , int start , int count , StringBuilder destination ) { for ( int i = 0 ; i < count ; i ++ ) { char codePoint = chars [ start + i ] ; if ( codePoint == '<' ) { destination . append ( LT ) ; } else if ( codePoint == '>' ) { destination . append ( GT ) ; } else if ( ...
Escapes a subset of a char sequence so that it is valid XML . Escaped or unchanged characters are added to destination .
9,665
public static void escapeXML ( StringBuilder sb ) { for ( int i = 0 ; i < sb . length ( ) ; ) { int codePoint = Character . codePointAt ( sb , i ) ; int length = Character . charCount ( codePoint ) ; if ( codePoint == '<' ) { sb . replace ( i , i + length , LT ) ; i += LT . length ( ) ; } else if ( codePoint == '>' ) {...
Escapes a string builder so that it is valid XML .
9,666
public void forward ( ServletRequest request , ServletResponse response ) throws ServletException , IOException { ScopedRequestImpl scopedRequest = ( ScopedRequestImpl ) ScopedServletUtils . unwrapRequest ( request ) ; assert scopedRequest != null : request . getClass ( ) . getName ( ) ; scopedRequest . setForwardedURI...
Does not actually cause a server forward of the request but informs the ScopedRequest object that a forward was attempted for a particular URI .
9,667
public void include ( ServletRequest request , ServletResponse response ) throws ServletException , IOException { assert request instanceof HttpServletRequest : request . getClass ( ) . getName ( ) ; HttpServletRequest httpRequest = ( HttpServletRequest ) request ; HttpServletRequest outerRequest = ScopedServletUtils ....
Does a server include of the stored URI into the given ScopedRequest and ScopedResponse .
9,668
public boolean containsKey ( Object key ) { if ( key == null ) throw new NullPointerException ( "Binding to a resource bundle does not accept a null key" ) ; BundleNodeMap map = lookupScriptableBundle ( key . toString ( ) ) ; return map != null ; }
Implementation of Map . containsKey for the bundle implicit object .
9,669
private MessageResources lookupDefaultStrutsBundle ( ) { Object value = _servletRequest . getAttribute ( Globals . MESSAGES_KEY ) ; if ( value instanceof MessageResources ) return ( MessageResources ) value ; else { if ( value != null ) LOGGER . warn ( "Can not resolve the default module bundle." + " The object resolv...
Lookup the default resource bundle for the current Struts module .
9,670
private MessageResources lookupStrutsBundle ( String name ) { Object value = _servletContext . getAttribute ( name ) ; if ( value instanceof MessageResources ) return ( MessageResources ) value ; else { if ( value != null ) LOGGER . warn ( "Can not resolve module bundle with name \"" + name + "\". The object resolved ...
Lookup a specific resource bundle for the current Struts module .
9,671
static long x ( long d , long m , long over ) { if ( d > over ) return Long . MAX_VALUE ; if ( d < - over ) return Long . MIN_VALUE ; return d * m ; }
Scale d by m checking for overflow . This has a short name to make above code more readable .
9,672
private void addActivityWithDataUsage ( String activity ) { Validate . notNull ( activity ) ; Validate . notEmpty ( activity ) ; Set < String > currentActivities = getActivitiesWithDataUsage ( ) ; currentActivities . add ( activity ) ; setProperty ( ProcessContextProperty . ACTIVITIES_WITH_DATA_USAGE , ArrayUtils . toS...
Adds an activity to the list of activities with data usage .
9,673
public Set < String > getActivitiesWithDataUsage ( ) { Set < String > result = new HashSet < > ( ) ; String propertyValue = getProperty ( ProcessContextProperty . ACTIVITIES_WITH_DATA_USAGE ) ; if ( propertyValue == null ) { return result ; } StringTokenizer activityTokens = StringUtils . splitArrayString ( propertyVal...
Returns the names of all activities with data usage .
9,674
public static XLogInfo create ( XLog log , XEventClassifier defaultClassifier , Collection < XEventClassifier > classifiers ) { return new XLogInfoImpl ( log , defaultClassifier , classifiers ) ; }
Creates a new log info summary with a collection of custom event classifiers .
9,675
protected synchronized void setup ( ) { registerAttributes ( logAttributeInfo , log ) ; for ( XTrace trace : log ) { numberOfTraces ++ ; registerAttributes ( traceAttributeInfo , trace ) ; XTimeBoundsImpl traceBounds = new XTimeBoundsImpl ( ) ; for ( XEvent event : trace ) { registerAttributes ( eventAttributeInfo , ev...
Creates the internal data structures of this summary on setup from the log .
9,676
protected void registerAttributes ( XAttributeInfoImpl attributeInfo , XAttributable attributable ) { if ( attributable . hasAttributes ( ) ) { for ( XAttribute attribute : attributable . getAttributes ( ) . values ( ) ) { attributeInfo . register ( attribute ) ; registerAttributes ( metaAttributeInfo , attribute ) ; }...
Registers all attributes of a given attributable i . e . model type hierarchy element in the given attribute info registry .
9,677
public void setValue ( Object value ) throws JspException { if ( value != null ) _state . value = value . toString ( ) ; else _state . value = null ; }
Set the value of this CheckBoxOption .
9,678
@ EventHandler ( field = "_resourceContext" , eventSet = ResourceEvents . class , eventName = "onAcquire" ) public void onAquire ( ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Enter: onAquire()" ) ; } try { getConnection ( ) ; } catch ( SQLException se ) { throw new ControlException ( "SQL Exception while...
Invoked by the controls runtime when a new instance of this class is aquired by the runtime
9,679
@ EventHandler ( field = "_resourceContext" , eventSet = ResourceContext . ResourceEvents . class , eventName = "onRelease" ) public void onRelease ( ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Enter: onRelease()" ) ; } for ( PreparedStatement ps : getResources ( ) ) { try { ps . close ( ) ; } catch ( SQ...
Invoked by the controls runtime when an instance of this class is released by the runtime
9,680
public Object invoke ( Method method , Object [ ] args ) throws Throwable { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Enter: invoke()" ) ; } assert _connection . isClosed ( ) == false : "invoke(): JDBC Connection has been closed!!!!" ; return execPreparedStatement ( method , args ) ; }
Called by the Controls runtime to handle calls to methods of an extensible control .
9,681
private Connection getConnectionFromDataSource ( String jndiName , Class < ? extends JdbcControl . JndiContextFactory > jndiFactory ) throws SQLException { Connection con = null ; try { JndiContextFactory jf = ( JndiContextFactory ) jndiFactory . newInstance ( ) ; Context jndiContext = jf . getContext ( ) ; _dataSource...
Get a connection from a DataSource .
9,682
private Connection getConnectionFromDriverManager ( String dbDriverClassName , String dbUrlStr , String userName , String password , String propertiesString ) throws SQLException { Connection con = null ; try { Class . forName ( dbDriverClassName ) ; if ( ! EMPTY_STRING . equals ( userName ) ) { con = DriverManager . g...
Get a JDBC connection from the DriverManager .
9,683
private void setTypeMappers ( TypeMapper [ ] typeMappers ) throws SQLException { if ( typeMappers . length > 0 ) { Map < String , Class < ? > > mappers = _connection . getTypeMap ( ) ; for ( TypeMapper t : typeMappers ) { mappers . put ( t . UDTName ( ) , t . mapperClass ( ) ) ; } _connection . setTypeMap ( mappers ) ;...
Set any custom type mappers specifed in the annotation for the connection . Used for mapping SQL UDTs to java classes .
9,684
public void addTagID ( String tagID , String name ) { if ( _focusMap == null ) { _focusMap = new HashMap ( ) ; } _focusMap . put ( tagID , name ) ; }
Adds a tagId and name to the Form s focusMap .
9,685
public int doStartTag ( ) throws JspException { if ( hasErrors ( ) ) return SKIP_BODY ; if ( getNearestForm ( ) != null ) { registerTagError ( Bundle . getString ( "Tags_FormParentForm" ) , null ) ; } HttpServletRequest request = ( HttpServletRequest ) pageContext . getRequest ( ) ; ServletContext servletContext = page...
Render the beginning of this form .
9,686
public int doAfterBody ( ) throws JspException { if ( bodyContent != null ) { String value = bodyContent . getString ( ) ; bodyContent . clearBody ( ) ; if ( value . length ( ) > 0 ) _text = value ; } return SKIP_BODY ; }
Save the body content of the Form .
9,687
private String renderNameAndId ( HttpServletRequest request , String id ) { if ( id == null ) return null ; String idScript = null ; IScriptReporter scriptReporter = getScriptReporter ( ) ; ScriptRequestState srs = ScriptRequestState . getScriptRequestState ( request ) ; if ( TagConfig . isLegacyJavaScript ( ) ) { idSc...
This mehtod will render the JavaScript associated with the id lookup if id has been set .
9,688
private void writeHiddenParam ( String paramName , String paramValue , AbstractRenderAppender results , ServletRequest req , boolean newLine ) { if ( newLine ) results . append ( "\n" ) ; _hiddenState . clear ( ) ; _hiddenState . name = paramName ; _hiddenState . value = paramValue ; TagRenderingBase hiddenTag = TagRen...
Write a hidden field for a paramter
9,689
public static boolean uriEndsWith ( String uri , String ending ) { int queryStart = uri . indexOf ( '?' ) ; if ( queryStart == - 1 ) { return uri . endsWith ( ending ) ; } else { return uri . length ( ) - queryStart >= ending . length ( ) && uri . substring ( queryStart - ending . length ( ) , queryStart ) . equals ( e...
Tell whether a URI ends in a given String .
9,690
public static String getFileExtension ( String filename ) { int lastDot = filename . lastIndexOf ( '.' ) ; return lastDot != - 1 ? filename . substring ( lastDot + 1 ) : "" ; }
Get the file extension from a file name .
9,691
public static boolean osSensitiveEquals ( String s1 , String s2 ) { if ( OS_CASE_SENSITIVE ) { return s1 . equals ( s2 ) ; } else { return s1 . equalsIgnoreCase ( s2 ) ; } }
Compare two strings with case sensitivity determined by the operating system .
9,692
public static boolean osSensitiveEndsWith ( String str , String suffix ) { if ( OS_CASE_SENSITIVE ) { return str . endsWith ( suffix ) ; } else { int strLen = str . length ( ) ; int suffixLen = suffix . length ( ) ; if ( strLen < suffixLen ) { return false ; } return ( str . substring ( strLen - suffixLen ) . equalsIgn...
Tell whether a string ends with a particular suffix with case sensitivity determined by the operating system .
9,693
public static void add ( HashMap html , HashMap htmlQuirks , HashMap xhtml ) { html . put ( ANCHOR_TAG , new Rendering ( ) ) ; htmlQuirks . put ( ANCHOR_TAG , new Rendering ( ) ) ; xhtml . put ( ANCHOR_TAG , new Rendering ( ) ) ; }
Add the Renderer for the HTML and XHTML tokens .
9,694
public AnnotationTypeElementDeclaration getElementDeclaration ( String elemName ) { if ( _elementMap . containsKey ( elemName ) ) return _elementMap . get ( elemName ) ; return null ; }
Returns the AnnotationTypeElementDeclaration for a particular element
9,695
public String getStringValue ( String elemName ) { if ( _valueMap . containsKey ( elemName ) ) return _valueMap . get ( elemName ) . toString ( ) ; return null ; }
Returns the value of a particular element as a String
9,696
public Object getObjectValue ( String elemName ) { if ( _valueMap . containsKey ( elemName ) ) return _valueMap . get ( elemName ) . getValue ( ) ; return null ; }
Returns the value of a particular element as an Object
9,697
public synchronized NikeFS2Block allocateBlock ( ) { int freeBlockIndex = blockAllocationMap . nextSetBit ( 0 ) ; if ( freeBlockIndex < 0 ) { return null ; } else { blockAllocationMap . set ( freeBlockIndex , false ) ; return new NikeFS2Block ( this , freeBlockIndex ) ; } }
Allocates a new block from this block provider .
9,698
public void setOnMouseUp ( String onMouseUp ) { _tbodyTag . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , HtmlConstants . ONMOUSEUP , onMouseUp ) ; }
Sets the onMouseUp JavaScript event for the HTML tbody tag .
9,699
public void setOnMouseMove ( String onMouseMove ) { _tbodyTag . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , HtmlConstants . ONMOUSEMOVE , onMouseMove ) ; }
Sets the onMouseMove JavaScript event for the HTML tbody tag .