idx int64 0 41.2k | question stringlengths 83 4.15k | target stringlengths 5 715 |
|---|---|---|
12,100 | public static BeanInfoIndexedProperty getBeanInfoIndexedProperty ( Class pClass , String pIndexedPropertyName , Logger pLogger ) throws ELException { return getBeanInfoManager ( pClass ) . getIndexedProperty ( pIndexedPropertyName , pLogger ) ; } | Returns the BeanInfoIndexedProperty for the specified property in the given class or null if not found . |
12,101 | void checkInitialized ( Logger pLogger ) throws ELException { if ( ! mInitialized ) { synchronized ( this ) { if ( ! mInitialized ) { initialize ( pLogger ) ; mInitialized = true ; } } } } | Makes sure that this class has been initialized and synchronizes the initialization if it s required . |
12,102 | void initialize ( Logger pLogger ) throws ELException { try { mBeanInfo = Introspector . getBeanInfo ( mBeanClass ) ; mPropertyByName = new HashMap ( ) ; mIndexedPropertyByName = new HashMap ( ) ; PropertyDescriptor [ ] pds = mBeanInfo . getPropertyDescriptors ( ) ; for ( int i = 0 ; pds != null && i < pds . length ; i... | Initializes by mapping property names to BeanInfoProperties |
12,103 | public BeanInfoProperty getProperty ( String pPropertyName , Logger pLogger ) throws ELException { checkInitialized ( pLogger ) ; return ( BeanInfoProperty ) mPropertyByName . get ( pPropertyName ) ; } | Returns the BeanInfoProperty for the given property name or null if not found . |
12,104 | public BeanInfoIndexedProperty getIndexedProperty ( String pIndexedPropertyName , Logger pLogger ) throws ELException { checkInitialized ( pLogger ) ; return ( BeanInfoIndexedProperty ) mIndexedPropertyByName . get ( pIndexedPropertyName ) ; } | Returns the BeanInfoIndexedProperty for the given property name or null if not found . |
12,105 | public EventSetDescriptor getEventSet ( String pEventSetName , Logger pLogger ) throws ELException { checkInitialized ( pLogger ) ; return ( EventSetDescriptor ) mEventSetByName . get ( pEventSetName ) ; } | Returns the EventSetDescriptor for the given event set name or null if not found . |
12,106 | static Method getPublicMethod ( Method pMethod ) { if ( pMethod == null ) { return null ; } Class cl = pMethod . getDeclaringClass ( ) ; if ( Modifier . isPublic ( cl . getModifiers ( ) ) ) { return pMethod ; } Method ret = getPublicMethod ( cl , pMethod ) ; if ( ret != null ) { return ret ; } else { return pMethod ; }... | Returns a publicly - accessible version of the given method by searching for a public declaring class . |
12,107 | static Method getPublicMethod ( Class pClass , Method pMethod ) { if ( Modifier . isPublic ( pClass . getModifiers ( ) ) ) { try { Method m ; try { m = pClass . getDeclaredMethod ( pMethod . getName ( ) , pMethod . getParameterTypes ( ) ) ; } catch ( java . security . AccessControlException ex ) { m = pClass . getMetho... | If the given class is public and has a Method that declares the same name and arguments as the given method then that method is returned . Otherwise the superclass and interfaces are searched recursively . |
12,108 | public int doStartTag ( ) throws JspException { if ( context != null && ( ! context . startsWith ( "/" ) || ! url . startsWith ( "/" ) ) ) { throw new JspTagException ( Resources . getMessage ( "IMPORT_BAD_RELATIVE" ) ) ; } urlWithParams = null ; params = new ParamSupport . ParamManager ( ) ; if ( url == null || url . ... | determines what kind of import and variable exposure to perform |
12,109 | public void doFinally ( ) { try { if ( varReader != null ) { if ( r != null ) { r . close ( ) ; } pageContext . removeAttribute ( varReader , PageContext . PAGE_SCOPE ) ; } } catch ( IOException ex ) { } } | cleans up if appropriate |
12,110 | public static void setSyncCache ( String name , Cache cache ) { if ( null == name || "" . equals ( name . trim ( ) ) || null == cache ) { return ; } GlobalSyncRedis . caches . put ( name , cache ) ; } | Set cache to the memory . |
12,111 | public static void removeSyncCache ( String name ) { if ( StrKit . isBlank ( name ) ) { return ; } if ( GlobalSyncRedis . caches . containsKey ( name ) ) { GlobalSyncRedis . caches . remove ( name ) ; } } | remove cache from memory . |
12,112 | public static Cache getSyncCache ( String name ) { if ( StrKit . isBlank ( name ) || ! GlobalSyncRedis . caches . containsKey ( name ) ) { return Redis . use ( ) ; } return GlobalSyncRedis . caches . get ( name ) ; } | Get cache from memory . |
12,113 | private String redisColumnKey ( SqlpKit . FLAG flag ) { StringBuilder key = new StringBuilder ( this . _getUsefulClass ( ) . toGenericString ( ) ) ; String [ ] attrs = this . _getAttrNames ( ) ; Object val ; for ( String attr : attrs ) { val = this . get ( attr ) ; if ( null == val ) { continue ; } key . append ( val .... | redis key for attrs values |
12,114 | private List < M > fetchDatasFromRedis ( String ... columns ) { String key = this . redisColumnKey ( SqlpKit . FLAG . ALL ) ; List < M > fetchDatas = this . redis ( ) . get ( key ) ; if ( null == fetchDatas ) { fetchDatas = this . find ( SqlpKit . select ( this , this . primaryKeys ( ) ) ) ; } if ( null == fetchDatas |... | Use the columns that must contains primary keys fetch Data from db and use the fetched primary keys fetch from redis . |
12,115 | public Class < ? > attrType ( String attr ) { Table table = this . table ( ) ; if ( null != table ) { return table . getColumnType ( attr ) ; } Method [ ] methods = this . _getUsefulClass ( ) . getMethods ( ) ; String methodName ; for ( Method method : methods ) { methodName = method . getName ( ) ; if ( methodName . s... | Get attr type |
12,116 | public List < String > attrNames ( ) { String [ ] names = this . _getAttrNames ( ) ; if ( null != names && names . length != 0 ) { return Arrays . asList ( names ) ; } Method [ ] methods = this . _getUsefulClass ( ) . getMethods ( ) ; String methodName ; List < String > attrs = new ArrayList < String > ( ) ; for ( Meth... | Get attr names |
12,117 | public Map < Object , Object > attrsCp ( ) { Map < Object , Object > attrs = new HashMap < Object , Object > ( ) ; String [ ] attrNames = this . _getAttrNames ( ) ; for ( String attr : attrNames ) { attrs . put ( attr , this . get ( attr ) ) ; } return attrs ; } | Model attr copy version the model just use default DbKit . brokenConfig |
12,118 | public void shotCacheName ( String cacheName ) { if ( StrKit . notBlank ( cacheName ) && ! cacheName . equals ( this . cacheName ) ) { GlobalSyncRedis . removeSyncCache ( this . cacheName ) ; } this . cacheName = cacheName ; this . syncToRedis = true ; ModelRedisMapping . me ( ) . put ( this . tableName ( ) , this . ca... | shot cache s name . if current cacheName ! = the old cacheName will reset old cache update cache use the current cacheName and open syncToRedis . |
12,119 | public boolean save ( ) { for ( CallbackListener callbackListener : this . callbackListeners ) { callbackListener . beforeSave ( this ) ; } boolean ret = super . save ( ) ; if ( this . syncToRedis && ret ) { this . saveToRedis ( ) ; } for ( CallbackListener callbackListener : this . callbackListeners ) { callbackListen... | save to db if syncToRedis is true this model will save to redis in the same time . |
12,120 | public boolean delete ( ) { for ( CallbackListener callbackListener : this . callbackListeners ) { callbackListener . beforeDelete ( this ) ; } boolean ret = super . delete ( ) ; if ( this . syncToRedis && ret ) { this . redis ( ) . del ( this . redisKey ( this ) ) ; } for ( CallbackListener callbackListener : this . c... | delete from db if syncToRedis is true this model will delete from redis in the same time . |
12,121 | public boolean update ( ) { for ( CallbackListener callbackListener : this . callbackListeners ) { callbackListener . beforeUpdate ( this ) ; } boolean ret = super . update ( ) ; if ( this . syncToRedis && ret ) { this . saveToRedis ( ) ; } for ( CallbackListener callbackListener : this . callbackListeners ) { callback... | update db if syncToRedis is true this model will update redis in the same time . |
12,122 | public int hcode ( ) { final int prime = 31 ; int result = 1 ; Table table = this . table ( ) ; Set < Entry < String , Object > > attrsEntrySet = this . _getAttrsEntrySet ( ) ; for ( Entry < String , Object > entry : attrsEntrySet ) { String key = entry . getKey ( ) ; Object value = entry . getValue ( ) ; Class < ? > c... | wrapper hash code |
12,123 | public static Class < ? > define ( ClassLoader loader ) { try { SecurityManager sm = System . getSecurityManager ( ) ; if ( sm != null ) { String packageName = DriverManagerAccessor . class . getPackage ( ) . getName ( ) ; RuntimePermission permission = new RuntimePermission ( "defineClassInPackage." + packageName ) ; ... | Definines the class using the given ClassLoader and ProtectionDomain |
12,124 | public synchronized ValidationMessage [ ] validate ( int type , String prefix , String uri , PageData page ) { try { this . tlvType = type ; this . uri = uri ; messageVector = new Vector ( ) ; this . prefix = prefix ; try { if ( config == null ) { configure ( ( String ) getInitParameters ( ) . get ( EXP_ATT_PARAM ) ) ;... | do the validation . |
12,125 | protected boolean isTag ( String tagUri , String tagLn , String matchUri , String matchLn ) { if ( tagUri == null || tagUri . length ( ) == 0 || tagLn == null || matchUri == null || matchLn == null ) { return false ; } if ( tagUri . length ( ) > matchUri . length ( ) ) { return ( tagUri . startsWith ( matchUri ) && tag... | utility methods to help us match elements in our tagset |
12,126 | protected boolean condition ( ) throws JspTagException { try { Object r = ExpressionEvaluatorManager . evaluate ( "test" , test , Boolean . class , this , pageContext ) ; if ( r == null ) { throw new NullAttributeException ( "when" , "test" ) ; } else { return ( ( ( Boolean ) r ) . booleanValue ( ) ) ; } } catch ( JspE... | Supplied conditional logic |
12,127 | public String logicalColumnName ( String columnName , String propertyName ) { return ! isNullOrEmpty ( columnName ) ? columnName : unqualify ( propertyName ) ; } | Return the column name or the unqualified property name |
12,128 | static DataSource getDataSource ( Object rawDataSource , PageContext pc ) throws JspException { DataSource dataSource = null ; if ( rawDataSource == null ) { rawDataSource = Config . find ( pc , Config . SQL_DATA_SOURCE ) ; } if ( rawDataSource == null ) { return null ; } if ( rawDataSource instanceof String ) { try { ... | If dataSource is a String first do JNDI lookup . If lookup fails parse String like it was a set of JDBC parameters Otherwise check to see if dataSource is a DataSource object and use as is |
12,129 | private static DataSource getDataSource ( String params ) throws JspException { DataSourceWrapper dataSource = new DataSourceWrapper ( ) ; String [ ] paramString = new String [ 4 ] ; int escCount = 0 ; int aryCount = 0 ; int begin = 0 ; for ( int index = 0 ; index < params . length ( ) ; index ++ ) { char nextChar = pa... | Parse JDBC parameters and setup dataSource appropriately |
12,130 | public static void main ( String args [ ] ) throws ParseException { SPathParser parser = new SPathParser ( System . in ) ; Path p = parser . expression ( ) ; java . util . List l = p . getSteps ( ) ; System . out . println ( ) ; if ( p instanceof AbsolutePath ) System . out . println ( "Root: /" ) ; for ( int i = 0 ; i... | Simple command - line parser interface primarily for testing . |
12,131 | final public Path expression ( ) throws ParseException { Path expr ; if ( jj_2_1 ( 2147483647 ) ) { expr = absolutePath ( ) ; jj_consume_token ( 0 ) ; } else { switch ( ( jj_ntk == - 1 ) ? jj_ntk ( ) : jj_ntk ) { case QNAME : case NSWILDCARD : case SLASH : case STAR : expr = relativePath ( ) ; jj_consume_token ( 0 ) ; ... | Actual SPath grammar |
12,132 | final public RelativePath relativePath ( ) throws ParseException { RelativePath relPath = null ; Step step ; step = step ( ) ; switch ( ( jj_ntk == - 1 ) ? jj_ntk ( ) : jj_ntk ) { case SLASH : jj_consume_token ( SLASH ) ; relPath = relativePath ( ) ; break ; default : jj_la1 [ 1 ] = jj_gen ; ; } { if ( true ) return ne... | as an example we use recursion here to handle a list |
12,133 | public static DocumentBuilder newDocumentBuilder ( ) { try { return PARSER_FACTORY . newDocumentBuilder ( ) ; } catch ( ParserConfigurationException e ) { throw ( Error ) new AssertionError ( ) . initCause ( e ) ; } } | Create a new DocumentBuilder configured for namespaces but not validating . |
12,134 | public static Transformer newTransformer ( Source source , JstlUriResolver uriResolver ) throws TransformerConfigurationException { TRANSFORMER_FACTORY . setURIResolver ( uriResolver ) ; Transformer transformer = TRANSFORMER_FACTORY . newTransformer ( source ) ; if ( transformer == null ) { throw new TransformerConfigu... | Create a new Transformer from an XSLT . |
12,135 | public static InputSource newInputSource ( Reader reader , String systemId ) { InputSource source = new InputSource ( reader ) ; source . setSystemId ( wrapSystemId ( systemId ) ) ; return source ; } | Create an InputSource from a Reader . |
12,136 | public static XMLReader newXMLReader ( JstlEntityResolver entityResolver ) throws ParserConfigurationException , SAXException { XMLReader xmlReader = SAXPARSER_FACTORY . newSAXParser ( ) . getXMLReader ( ) ; xmlReader . setEntityResolver ( entityResolver ) ; return xmlReader ; } | Create an XMLReader that resolves entities using JSTL semantics . |
12,137 | public static SAXSource newSAXSource ( Reader reader , String systemId , JstlEntityResolver entityResolver ) throws ParserConfigurationException , SAXException { SAXSource source = new SAXSource ( newXMLReader ( entityResolver ) , new InputSource ( reader ) ) ; source . setSystemId ( wrapSystemId ( systemId ) ) ; retur... | Create a SAXSource from a Reader . Any entities will be resolved using JSTL semantics . |
12,138 | private static < T , E extends Exception > T runWithOurClassLoader ( final Callable < T > action , Class < E > allowed ) throws E { PrivilegedExceptionAction < T > actionWithClassloader = new PrivilegedExceptionAction < T > ( ) { public T run ( ) throws Exception { ClassLoader original = Thread . currentThread ( ) . ge... | Performs an action using this Class s ClassLoader as the Thread context ClassLoader . |
12,139 | public SelectRootClauseBuilder < ? extends QueryForNumber > count ( ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( "SELECT count(*)" ) ; sb . append ( " FROM " ) . append ( definition . getSqlName ( ) ) ; SelectRootClauseBuilder < ? extends QueryForNumber > r = SelectRootClauseBuilder . newInstance ( new ... | FIXME This may not work . |
12,140 | protected void prepare ( ) throws JspTagException { if ( rawItems == null ) { items = new ToEndIterator ( end ) ; } else if ( rawItems instanceof ValueExpression ) { deferredExpression = ( ValueExpression ) rawItems ; Object o = deferredExpression . getValue ( pageContext . getELContext ( ) ) ; Iterator iterator = toIt... | our raw items |
12,141 | void exportToVariable ( Object result ) throws JspTagException { int scopeValue = Util . getScope ( scope ) ; ELContext myELContext = pageContext . getELContext ( ) ; VariableMapper vm = myELContext . getVariableMapper ( ) ; if ( result != null ) { if ( result instanceof ValueExpression ) { if ( scopeValue != PageConte... | Export the result into a scoped variable . |
12,142 | void exportToMapProperty ( Object target , String property , Object result ) { @ SuppressWarnings ( "unchecked" ) Map < Object , Object > map = ( Map < Object , Object > ) target ; if ( result == null ) { map . remove ( property ) ; } else { map . put ( property , result ) ; } } | Export the result into a Map . |
12,143 | void exportToBeanProperty ( Object target , String property , Object result ) throws JspTagException { PropertyDescriptor [ ] descriptors ; try { descriptors = Introspector . getBeanInfo ( target . getClass ( ) ) . getPropertyDescriptors ( ) ; } catch ( IntrospectionException ex ) { throw new JspTagException ( ex ) ; }... | Export the result into a bean property . |
12,144 | private Object convertToExpectedType ( final Object value , Method m ) throws ELException { if ( value == null ) { return null ; } Class < ? > expectedType = m . getParameterTypes ( ) [ 0 ] ; return getExpressionFactory ( ) . coerceToType ( value , expectedType ) ; } | Convert an object to an expected type of the method parameter according to the conversion rules of the Expression Language . |
12,145 | private static Class < ? > [ ] types ( Object ... values ) { if ( values == null ) { return new Class [ 0 ] ; } Class < ? > [ ] result = new Class [ values . length ] ; for ( int i = 0 ; i < values . length ; i ++ ) { Object value = values [ i ] ; result [ i ] = value == null ? Object . class : value . getClass ( ) ; }... | Get an array of types for an array of objects |
12,146 | public ValidationMessage [ ] validate ( String prefix , String uri , PageData page ) { return super . validate ( TYPE_CORE , prefix , uri , page ) ; } | set its type and delegate validation to super - class |
12,147 | @ SuppressWarnings ( "unchecked" ) public static < K , V > Map < K , V > jsonToMap ( String json ) { return FastJsonKit . parse ( json , HashMap . class ) ; } | json string to map |
12,148 | public static Record jsonToRecord ( String json ) { Map < String , Object > map = jsonToMap ( json ) ; return new Record ( ) . setColumns ( map ) ; } | json to Record |
12,149 | public static Object coerce ( Object pValue , Class pClass , Logger pLogger ) throws ELException { if ( pClass == String . class ) { return coerceToString ( pValue , pLogger ) ; } else if ( isPrimitiveNumberClass ( pClass ) ) { return coerceToPrimitiveNumber ( pValue , pClass , pLogger ) ; } else if ( pClass == Charact... | Coerces the given value to the specified class . |
12,150 | static boolean isPrimitiveNumberClass ( Class pClass ) { return pClass == Byte . class || pClass == Byte . TYPE || pClass == Short . class || pClass == Short . TYPE || pClass == Integer . class || pClass == Integer . TYPE || pClass == Long . class || pClass == Long . TYPE || pClass == Float . class || pClass == Float .... | Returns true if the given class is Byte Short Integer Long Float Double |
12,151 | public static String coerceToString ( Object pValue , Logger pLogger ) throws ELException { if ( pValue == null ) { return "" ; } else if ( pValue instanceof String ) { return ( String ) pValue ; } else { try { return pValue . toString ( ) ; } catch ( Exception exc ) { if ( pLogger . isLoggingError ( ) ) { pLogger . lo... | Coerces the specified value to a String |
12,152 | public static Number coerceToPrimitiveNumber ( Object pValue , Class pClass , Logger pLogger ) throws ELException { if ( pValue == null || "" . equals ( pValue ) ) { return coerceToPrimitiveNumber ( 0 , pClass ) ; } else if ( pValue instanceof Character ) { char val = ( ( Character ) pValue ) . charValue ( ) ; return c... | Coerces a value to the given primitive number class |
12,153 | public static Integer coerceToInteger ( Object pValue , Logger pLogger ) throws ELException { if ( pValue == null ) { return null ; } else if ( pValue instanceof Character ) { return PrimitiveObjects . getInteger ( ( int ) ( ( ( Character ) pValue ) . charValue ( ) ) ) ; } else if ( pValue instanceof Boolean ) { if ( p... | Coerces a value to an Integer returning null if the coercion isn t possible . |
12,154 | static Number coerceToPrimitiveNumber ( long pValue , Class pClass ) throws ELException { if ( pClass == Byte . class || pClass == Byte . TYPE ) { return PrimitiveObjects . getByte ( ( byte ) pValue ) ; } else if ( pClass == Short . class || pClass == Short . TYPE ) { return PrimitiveObjects . getShort ( ( short ) pVal... | Coerces a long to the given primitive number class |
12,155 | static Number coerceToPrimitiveNumber ( Number pValue , Class pClass ) throws ELException { if ( pClass == Byte . class || pClass == Byte . TYPE ) { return PrimitiveObjects . getByte ( pValue . byteValue ( ) ) ; } else if ( pClass == Short . class || pClass == Short . TYPE ) { return PrimitiveObjects . getShort ( pValu... | Coerces a Number to the given primitive number class |
12,156 | static Number coerceToPrimitiveNumber ( String pValue , Class pClass ) throws ELException { if ( pClass == Byte . class || pClass == Byte . TYPE ) { return Byte . valueOf ( pValue ) ; } else if ( pClass == Short . class || pClass == Short . TYPE ) { return Short . valueOf ( pValue ) ; } else if ( pClass == Integer . cl... | Coerces a String to the given primitive number class |
12,157 | public static Character coerceToCharacter ( Object pValue , Logger pLogger ) throws ELException { if ( pValue == null || "" . equals ( pValue ) ) { return PrimitiveObjects . getCharacter ( ( char ) 0 ) ; } else if ( pValue instanceof Character ) { return ( Character ) pValue ; } else if ( pValue instanceof Boolean ) { ... | Coerces a value to a Character |
12,158 | public static Boolean coerceToBoolean ( Object pValue , Logger pLogger ) throws ELException { if ( pValue == null || "" . equals ( pValue ) ) { return Boolean . FALSE ; } else if ( pValue instanceof Boolean ) { return ( Boolean ) pValue ; } else if ( pValue instanceof String ) { String str = ( String ) pValue ; try { r... | Coerces a value to a Boolean |
12,159 | public static Object coerceToObject ( Object pValue , Class pClass , Logger pLogger ) throws ELException { if ( pValue == null ) { return null ; } else if ( pClass . isAssignableFrom ( pValue . getClass ( ) ) ) { return pValue ; } else if ( pValue instanceof String ) { String str = ( String ) pValue ; PropertyEditor pe... | Coerces a value to the specified Class that is not covered by any of the above cases |
12,160 | public static boolean isFloatingPointType ( Class pClass ) { return pClass == Float . class || pClass == Float . TYPE || pClass == Double . class || pClass == Double . TYPE ; } | Returns true if the given class is of a floating point type |
12,161 | public static boolean isFloatingPointString ( Object pObject ) { if ( pObject instanceof String ) { String str = ( String ) pObject ; int len = str . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { char ch = str . charAt ( i ) ; if ( ch == '.' || ch == 'e' || ch == 'E' ) { return true ; } } return false ; } else { re... | Returns true if the given string might contain a floating point number - i . e . it contains . e or E |
12,162 | public static boolean isIntegerType ( Class pClass ) { return pClass == Byte . class || pClass == Byte . TYPE || pClass == Short . class || pClass == Short . TYPE || pClass == Character . class || pClass == Character . TYPE || pClass == Integer . class || pClass == Integer . TYPE || pClass == Long . class || pClass == ... | Returns true if the given class is of an integer type |
12,163 | public List < UploadFile > getFilesSaveToDatePath ( Integer maxPostSize , String encoding ) { return super . getFiles ( UploadPathKit . getDatePath ( ) , maxPostSize , encoding ) ; } | Get upload file save to date path . |
12,164 | public BigInteger getParaToBigInteger ( String name , BigInteger defaultValue ) { return this . toBigInteger ( getPara ( name ) , defaultValue ) ; } | Returns the value of a request parameter and convert to BigInteger with a default value if it is null . |
12,165 | public Object resolveVariable ( String pName , Object pContext ) throws ELException { PageContext ctx = ( PageContext ) pContext ; if ( "pageContext" . equals ( pName ) ) { return ctx ; } else if ( "pageScope" . equals ( pName ) ) { return ImplicitObjects . getImplicitObjects ( ctx ) . getPageScopeMap ( ) ; } else if (... | Resolves the specified variable within the given context . Returns null if the variable is not found . |
12,166 | public List getSteps ( ) { List l ; if ( next != null ) l = next . getSteps ( ) ; else l = new Vector ( ) ; l . add ( 0 , step ) ; return l ; } | inherit JavaDoc comment |
12,167 | public static String marshal ( Object jaxbElement ) { StringWriter sw ; try { Marshaller fm = JAXBContext . newInstance ( jaxbElement . getClass ( ) ) . createMarshaller ( ) ; fm . setProperty ( Marshaller . JAXB_FORMATTED_OUTPUT , true ) ; sw = new StringWriter ( ) ; fm . marshal ( jaxbElement , sw ) ; } catch ( JAXBE... | object - > string |
12,168 | public void setInitParameters ( Map < java . lang . String , java . lang . Object > initParms ) { super . setInitParameters ( initParms ) ; String declarationsParm = ( String ) initParms . get ( "allowDeclarations" ) ; String scriptletsParm = ( String ) initParms . get ( "allowScriptlets" ) ; String expressionsParm = (... | Sets the values of the initialization parameters as supplied in the TLD . |
12,169 | public ValidationMessage [ ] validate ( String prefix , String uri , PageData page ) { try { MyContentHandler handler = new MyContentHandler ( ) ; parser . parse ( page , handler ) ; return handler . reportResults ( ) ; } catch ( ParserConfigurationException e ) { return vmFromString ( e . toString ( ) ) ; } catch ( SA... | Validates a single JSP page . |
12,170 | public boolean apply ( String pLeft , String pRight , Logger pLogger ) { return pLeft . compareTo ( pRight ) <= 0 ; } | Applies the operator to the given String values |
12,171 | @ Before ( "@within(org.audit4j.core.annotation.Audit) || @annotation(org.audit4j.core.annotation.Audit)" ) public void audit ( final JoinPoint jointPoint ) throws Throwable { MethodSignature methodSignature = ( MethodSignature ) jointPoint . getSignature ( ) ; Method method = methodSignature . getMethod ( ) ; if ( met... | Audit Aspect . |
12,172 | final public Expression ValuePrefix ( ) throws ParseException { Expression ret ; switch ( ( jj_ntk == - 1 ) ? jj_ntk ( ) : jj_ntk ) { case INTEGER_LITERAL : case FLOATING_POINT_LITERAL : case STRING_LITERAL : case TRUE : case FALSE : case NULL : ret = Literal ( ) ; break ; case LPAREN : jj_consume_token ( LPAREN ) ; re... | This is an element that can start a value |
12,173 | public Object evaluate ( String pExpressionString , Object pContext , Class pExpectedType , Map functions , String defaultPrefix ) throws ELException { return evaluate ( pExpressionString , pContext , pExpectedType , functions , defaultPrefix , sLogger ) ; } | Evaluates the given expression String |
12,174 | Object evaluate ( String pExpressionString , Object pContext , Class pExpectedType , Map functions , String defaultPrefix , Logger pLogger ) throws ELException { if ( pExpressionString == null ) { throw new ELException ( Constants . NULL_EXPRESSION_STRING ) ; } pageContext = ( PageContext ) pContext ; Object parsedValu... | Evaluates the given expression string |
12,175 | Object convertToExpectedType ( Object pValue , Class pExpectedType , Logger pLogger ) throws ELException { return Coercions . coerce ( pValue , pExpectedType , pLogger ) ; } | Converts the given value to the specified expected type . |
12,176 | Object convertStaticValueToExpectedType ( String pValue , Class pExpectedType , Logger pLogger ) throws ELException { if ( pExpectedType == String . class || pExpectedType == Object . class ) { return pValue ; } Map valueByString = getOrCreateExpectedTypeMap ( pExpectedType ) ; if ( ! mBypassCache && valueByString . co... | Converts the given String specified as a static expression string to the given expected type . The conversion is cached . |
12,177 | static Map getOrCreateExpectedTypeMap ( Class pExpectedType ) { synchronized ( sCachedExpectedTypes ) { Map ret = ( Map ) sCachedExpectedTypes . get ( pExpectedType ) ; if ( ret == null ) { ret = Collections . synchronizedMap ( new HashMap ( ) ) ; sCachedExpectedTypes . put ( pExpectedType , ret ) ; } return ret ; } } | Creates or returns the Map that maps string literals to parsed values for the specified expected type . |
12,178 | private synchronized void createExpressionStringMap ( ) { if ( sCachedExpressionStrings != null ) { return ; } final int maxSize ; if ( ( pageContext != null ) && ( pageContext . getServletContext ( ) != null ) ) { String value = pageContext . getServletContext ( ) . getInitParameter ( EXPR_CACHE_PARAM ) ; if ( value !... | Creates LRU map of expression strings . If context parameter specifying cache size is present use that as the maximum size of the LRU map otherwise use default . |
12,179 | static String formatParseException ( String pExpressionString , ParseException pExc ) { StringBuffer expectedBuf = new StringBuffer ( ) ; int maxSize = 0 ; boolean printedOne = false ; if ( pExc . expectedTokenSequences == null ) { return pExc . toString ( ) ; } for ( int i = 0 ; i < pExc . expectedTokenSequences . len... | Formats a ParseException into an error message suitable for displaying on a web page |
12,180 | public String parseAndRender ( String pExpressionString ) throws ELException { Object val = parseExpressionString ( pExpressionString ) ; if ( val instanceof String ) { return ( String ) val ; } else if ( val instanceof Expression ) { return "${" + ( ( Expression ) val ) . getExpressionString ( ) + "}" ; } else if ( va... | Parses the given expression string then converts it back to a String in its canonical form . This is used to test parsing . |
12,181 | Source getSourceFromXmlAttribute ( ) throws JspTagException , SAXException , ParserConfigurationException { Object xml = this . xml ; if ( xml == null ) { throw new JspTagException ( Resources . getMessage ( "TRANSFORM_XML_IS_NULL" ) ) ; } if ( xml instanceof List ) { List < ? > list = ( List < ? > ) xml ; if ( list . ... | Return the Source for a document specified in the doc or xml attribute . |
12,182 | Source getSourceFromBodyContent ( ) throws JspTagException , SAXException , ParserConfigurationException { if ( bodyContent == null ) { throw new JspTagException ( Resources . getMessage ( "TRANSFORM_BODY_IS_NULL" ) ) ; } String s = bodyContent . getString ( ) ; if ( s == null ) { throw new JspTagException ( Resources ... | Return the Source for a document specified as body content . |
12,183 | public String validate ( String pAttributeName , String pAttributeValue ) { try { sEvaluator . setBypassCache ( true ) ; sEvaluator . parseExpressionString ( pAttributeValue ) ; sEvaluator . setBypassCache ( false ) ; return null ; } catch ( ELException exc ) { return MessageFormat . format ( Constants . ATTRIBUTE_PARS... | Translation time validation of an attribute value . This method will return a null String if the attribute value is valid ; otherwise an error message . |
12,184 | public Object evaluate ( String pAttributeName , String pAttributeValue , Class pExpectedType , Tag pTag , PageContext pPageContext , Map functions , String defaultPrefix ) throws JspException { try { return sEvaluator . evaluate ( pAttributeValue , pPageContext , pExpectedType , functions , defaultPrefix ) ; } catch (... | Evaluates the expression at request time |
12,185 | public Object evaluate ( String pAttributeName , String pAttributeValue , Class pExpectedType , Tag pTag , PageContext pPageContext ) throws JspException { return evaluate ( pAttributeName , pAttributeValue , pExpectedType , pTag , pPageContext , null , null ) ; } | Conduit to old - style call for convenience . |
12,186 | public static String parseAndRender ( String pAttributeValue ) throws JspException { try { return sEvaluator . parseAndRender ( pAttributeValue ) ; } catch ( ELException exc ) { throw new JspException ( MessageFormat . format ( Constants . ATTRIBUTE_PARSE_EXCEPTION , "test" , "" + pAttributeValue , exc . getMessage ( )... | Parses the given attribute value then converts it back to a String in its canonical form . |
12,187 | public VariableInfo [ ] getVariableInfo ( TagData data ) { VariableInfo id = new VariableInfo ( data . getAttributeString ( "id" ) , data . getAttributeString ( "type" ) == null ? "java.lang.Object" : data . getAttributeString ( "type" ) , true , VariableInfo . AT_END ) ; return new VariableInfo [ ] { id } ; } | purposely inherit JavaDoc and semantics from TagExtraInfo |
12,188 | public void setScope ( String scopeName ) { if ( "page" . equals ( scopeName ) ) { scope = PageContext . PAGE_SCOPE ; } else if ( "request" . equals ( scopeName ) ) { scope = PageContext . REQUEST_SCOPE ; } else if ( "session" . equals ( scopeName ) ) { scope = PageContext . SESSION_SCOPE ; } else if ( "application" . ... | Setter method for the scope of the variable to hold the result . |
12,189 | public void afterPropertiesSet ( ) throws Exception { Configuration configuration = Configuration . INSTANCE ; configuration . setLayout ( layout ) ; configuration . setHandlers ( handlers ) ; configuration . setFilters ( filters ) ; configuration . setCommands ( commands ) ; configuration . setJmx ( jmx ) ; configurat... | Initialize audit4j when starting spring application context . |
12,190 | public static String escape ( String src ) { int length = 0 ; for ( int i = 0 ; i < src . length ( ) ; i ++ ) { char c = src . charAt ( i ) ; String escape = getEscape ( c ) ; if ( escape != null ) { length += escape . length ( ) ; } else { length += 1 ; } } if ( length == src . length ( ) ) { return src ; } StringBuil... | Escape a string . |
12,191 | public static void emit ( Object src , boolean escapeXml , JspWriter out ) throws IOException { if ( src instanceof Reader ) { emit ( ( Reader ) src , escapeXml , out ) ; } else { emit ( String . valueOf ( src ) , escapeXml , out ) ; } } | Emit the supplied object to the specified writer escaping characters if needed . |
12,192 | public static void emit ( String src , boolean escapeXml , JspWriter out ) throws IOException { if ( escapeXml ) { emit ( src , out ) ; } else { out . write ( src ) ; } } | Emit the supplied String to the specified writer escaping characters if needed . |
12,193 | public static void emit ( Reader src , boolean escapeXml , JspWriter out ) throws IOException { int bufferSize = out . getBufferSize ( ) ; if ( bufferSize == 0 ) { bufferSize = 4096 ; } char [ ] buffer = new char [ bufferSize ] ; int count ; while ( ( count = src . read ( buffer ) ) > 0 ) { if ( escapeXml ) { emit ( bu... | Copy the content of a Reader into the specified JSPWriter escaping characters if needed . |
12,194 | public void addSQLParameter ( Object o ) { if ( parameters == null ) { parameters = new ArrayList ( ) ; } parameters . add ( o ) ; } | Called by nested parameter elements to add PreparedStatement parameter values . |
12,195 | public Object evaluate ( Object pContext , VariableResolver pResolver , Map functions , String defaultPrefix , Logger pLogger ) throws ELException { Object ret = mPrefix . evaluate ( pContext , pResolver , functions , defaultPrefix , pLogger ) ; for ( int i = 0 ; mSuffixes != null && i < mSuffixes . size ( ) ; i ++ ) {... | Evaluates by evaluating the prefix then applying the suffixes |
12,196 | public void configInterceptor ( Interceptors me ) { me . add ( new ExceptionInterceptor ( ) ) ; if ( this . getHttpPostMethod ( ) ) { me . add ( new POST ( ) ) ; } configMoreInterceptors ( me ) ; } | Config interceptor applied to all actions . |
12,197 | public int doStartTag ( ) throws JspException { try { XPathContext context = XalanUtil . getContext ( this , pageContext ) ; String result = select . execute ( context , context . getCurrentNode ( ) , null ) . str ( ) ; EscapeXML . emit ( result , escapeXml , pageContext . getOut ( ) ) ; return SKIP_BODY ; } catch ( IO... | applies XPath expression from select and prints the result |
12,198 | public static ImplicitObjects getImplicitObjects ( PageContext pContext ) { ImplicitObjects objs = ( ImplicitObjects ) pContext . getAttribute ( sAttributeName , PageContext . PAGE_SCOPE ) ; if ( objs == null ) { objs = new ImplicitObjects ( pContext ) ; pContext . setAttribute ( sAttributeName , objs , PageContext . P... | Finds the ImplicitObjects associated with the PageContext creating it if it doesn t yet exist . |
12,199 | public static Map createSessionScopeMap ( PageContext pContext ) { final PageContext context = pContext ; return new EnumeratedMap ( ) { public Enumeration enumerateKeys ( ) { return context . getAttributeNamesInScope ( PageContext . SESSION_SCOPE ) ; } public Object getValue ( Object pKey ) { if ( pKey instanceof Stri... | Creates the Map that wraps session - scoped attributes |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.