idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
135,800
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 .
135,801
public static void removeSyncCache ( String name ) { if ( StrKit . isBlank ( name ) ) { return ; } if ( GlobalSyncRedis . caches . containsKey ( name ) ) { GlobalSyncRedis . caches . remove ( name ) ; } }
remove cache from memory .
135,802
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 .
135,803
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
135,804
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 .
135,805
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
135,806
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
135,807
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
135,808
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 .
135,809
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 .
135,810
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 .
135,811
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 .
135,812
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
135,813
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
135,814
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 .
135,815
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
135,816
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
135,817
public String logicalColumnName ( String columnName , String propertyName ) { return ! isNullOrEmpty ( columnName ) ? columnName : unqualify ( propertyName ) ; }
Return the column name or the unqualified property name
135,818
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
135,819
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
135,820
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 .
135,821
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
135,822
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
135,823
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 .
135,824
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 .
135,825
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 .
135,826
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 .
135,827
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 .
135,828
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 .
135,829
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 .
135,830
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
135,831
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 .
135,832
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 .
135,833
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 .
135,834
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 .
135,835
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
135,836
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
135,837
@ SuppressWarnings ( "unchecked" ) public static < K , V > Map < K , V > jsonToMap ( String json ) { return FastJsonKit . parse ( json , HashMap . class ) ; }
json string to map
135,838
public static Record jsonToRecord ( String json ) { Map < String , Object > map = jsonToMap ( json ) ; return new Record ( ) . setColumns ( map ) ; }
json to Record
135,839
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 .
135,840
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
135,841
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
135,842
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
135,843
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 .
135,844
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
135,845
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
135,846
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
135,847
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
135,848
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
135,849
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
135,850
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
135,851
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
135,852
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
135,853
public List < UploadFile > getFilesSaveToDatePath ( Integer maxPostSize , String encoding ) { return super . getFiles ( UploadPathKit . getDatePath ( ) , maxPostSize , encoding ) ; }
Get upload file save to date path .
135,854
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 .
135,855
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 .
135,856
public List getSteps ( ) { List l ; if ( next != null ) l = next . getSteps ( ) ; else l = new Vector ( ) ; l . add ( 0 , step ) ; return l ; }
inherit JavaDoc comment
135,857
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
135,858
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 .
135,859
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 .
135,860
public boolean apply ( String pLeft , String pRight , Logger pLogger ) { return pLeft . compareTo ( pRight ) <= 0 ; }
Applies the operator to the given String values
135,861
@ 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 .
135,862
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
135,863
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
135,864
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
135,865
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 .
135,866
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 .
135,867
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 .
135,868
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 .
135,869
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
135,870
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 .
135,871
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 .
135,872
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 .
135,873
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 .
135,874
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
135,875
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 .
135,876
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 .
135,877
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
135,878
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 .
135,879
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 .
135,880
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 .
135,881
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 .
135,882
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 .
135,883
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 .
135,884
public void addSQLParameter ( Object o ) { if ( parameters == null ) { parameters = new ArrayList ( ) ; } parameters . add ( o ) ; }
Called by nested parameter elements to add PreparedStatement parameter values .
135,885
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
135,886
public void configInterceptor ( Interceptors me ) { me . add ( new ExceptionInterceptor ( ) ) ; if ( this . getHttpPostMethod ( ) ) { me . add ( new POST ( ) ) ; } configMoreInterceptors ( me ) ; }
Config interceptor applied to all actions .
135,887
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
135,888
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 .
135,889
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
135,890
public static Map createParamMap ( PageContext pContext ) { final HttpServletRequest request = ( HttpServletRequest ) pContext . getRequest ( ) ; return new EnumeratedMap ( ) { public Enumeration enumerateKeys ( ) { return request . getParameterNames ( ) ; } public Object getValue ( Object pKey ) { if ( pKey instanceof...
Creates the Map that maps parameter name to single parameter value .
135,891
public static Map createHeaderMap ( PageContext pContext ) { final HttpServletRequest request = ( HttpServletRequest ) pContext . getRequest ( ) ; return new EnumeratedMap ( ) { public Enumeration enumerateKeys ( ) { return request . getHeaderNames ( ) ; } public Object getValue ( Object pKey ) { if ( pKey instanceof S...
Creates the Map that maps header name to single header value .
135,892
public static Map createHeadersMap ( PageContext pContext ) { final HttpServletRequest request = ( HttpServletRequest ) pContext . getRequest ( ) ; return new EnumeratedMap ( ) { public Enumeration enumerateKeys ( ) { return request . getHeaderNames ( ) ; } public Object getValue ( Object pKey ) { if ( pKey instanceof ...
Creates the Map that maps header name to an array of header values .
135,893
public static Map createInitParamMap ( PageContext pContext ) { final ServletContext context = pContext . getServletContext ( ) ; return new EnumeratedMap ( ) { public Enumeration enumerateKeys ( ) { return context . getInitParameterNames ( ) ; } public Object getValue ( Object pKey ) { if ( pKey instanceof String ) { ...
Creates the Map that maps init parameter name to single init parameter value .
135,894
public int doStartTag ( ) throws JspException { try { SPathFilter s = new SPathFilter ( new SPathParser ( select ) . expression ( ) ) ; pageContext . setAttribute ( var , s ) ; return SKIP_BODY ; } catch ( ParseException ex ) { throw new JspTagException ( ex . toString ( ) , ex ) ; } }
applies XPath expression from select and exposes a filter as var
135,895
public boolean isMatchingName ( String uri , String localPart ) { if ( localPart == null ) throw new IllegalArgumentException ( "need non-null localPart" ) ; if ( uri != null && uri . equals ( "" ) ) uri = null ; if ( this . localPart == null && this . uri == null ) parseStepName ( ) ; if ( this . uri == null && this ....
Returns true if the given name matches the Step object s name taking into account the Step object s wildcards ; returns false otherwise .
135,896
private void parseStepName ( ) { String prefix ; int colonIndex = name . indexOf ( ":" ) ; if ( colonIndex == - 1 ) { prefix = null ; localPart = name ; } else { prefix = name . substring ( 0 , colonIndex ) ; localPart = name . substring ( colonIndex + 1 ) ; } uri = mapPrefix ( prefix ) ; }
Lazily computes some information about our name .
135,897
public static XPathContext getContext ( Tag child , PageContext pageContext ) { ForEachTag forEachTag = ( ForEachTag ) TagSupport . findAncestorWithClass ( child , ForEachTag . class ) ; if ( forEachTag != null ) { return forEachTag . getContext ( ) ; } XPathContext context = new XPathContext ( false ) ; VariableStack ...
Return the XPathContext to be used for evaluating expressions .
135,898
static Object coerceToJava ( XObject xo ) throws TransformerException { if ( xo instanceof XBoolean ) { return xo . bool ( ) ; } else if ( xo instanceof XNumber ) { return xo . num ( ) ; } else if ( xo instanceof XString ) { return xo . str ( ) ; } else if ( xo instanceof XNodeSet ) { NodeList nodes = xo . nodelist ( )...
Return the Java value corresponding to an XPath result .
135,899
public int doStartTag ( ) throws JspException { if ( end != - 1 && begin > end ) { return SKIP_BODY ; } index = 0 ; count = 1 ; last = false ; prepare ( ) ; discardIgnoreSubset ( begin ) ; if ( hasNext ( ) ) { item = next ( ) ; } else { return SKIP_BODY ; } discard ( step - 1 ) ; exposeVariables ( ) ; calibrateLast ( )...
Begins iterating by processing the first item .