idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
34,000 | public void deleteProperty ( String name ) { String [ ] propName = parsePropertyName ( name ) ; Element element = doc . getRootElement ( ) ; for ( int i = 0 ; i < propName . length - 1 ; i ++ ) { element = element . getChild ( propName [ i ] ) ; if ( element == null ) { return ; } } element . removeChild ( propName [ p... | Deletes the specified property . |
34,001 | private String [ ] parsePropertyName ( String name ) { int size = 1 ; for ( int i = 0 ; i < name . length ( ) ; i ++ ) { if ( name . charAt ( i ) == '.' ) { size ++ ; } } String [ ] propName = new String [ size ] ; StringTokenizer tokenizer = new StringTokenizer ( name , "." ) ; int i = 0 ; while ( tokenizer . hasMoreT... | Returns an array representation of the given Jive property . Jive properties are always in the format prop . name . is . this which would be represented as an array of four Strings . |
34,002 | public static boolean isWhitespace ( String s ) { if ( isEmpty ( s ) ) return true ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { char c = s . charAt ( i ) ; if ( whitespace . indexOf ( c ) == - 1 ) return false ; } return true ; } | Returns true if string s is empty or whitespace characters only . |
34,003 | public static String stripCharsInBag ( String s , String bag ) { int i ; String returnString = "" ; for ( i = 0 ; i < s . length ( ) ; i ++ ) { char c = s . charAt ( i ) ; if ( bag . indexOf ( c ) == - 1 ) returnString += c ; } return returnString ; } | Removes all characters which appear in string bag from string s . |
34,004 | public static boolean isInteger ( String s ) { if ( isEmpty ( s ) ) return defaultEmptyOK ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { char c = s . charAt ( i ) ; if ( ! isDigit ( c ) ) return false ; } return true ; } | Returns true if all characters in string s are numbers . |
34,005 | public static boolean isNonnegativeInteger ( String s ) { if ( isEmpty ( s ) ) return defaultEmptyOK ; try { int temp = Integer . parseInt ( s ) ; if ( temp >= 0 ) return true ; return false ; } catch ( Exception e ) { return false ; } } | Returns true if string s is an integer > = 0 . |
34,006 | public static boolean isAlphabetic ( String s ) { if ( isEmpty ( s ) ) return defaultEmptyOK ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { char c = s . charAt ( i ) ; if ( ! isLetter ( c ) ) return false ; } return true ; } | Returns true if string s is letters only . |
34,007 | public static boolean isSSN ( String s ) { if ( isEmpty ( s ) ) return defaultEmptyOK ; String normalizedSSN = stripCharsInBag ( s , SSNDelimiters ) ; return ( isInteger ( normalizedSSN ) && normalizedSSN . length ( ) == digitsInSocialSecurityNumber ) ; } | isSSN returns true if string s is a valid U . S . Social Security Number . Must be 9 digits . |
34,008 | public static boolean isUSPhoneNumber ( String s ) { if ( isEmpty ( s ) ) return defaultEmptyOK ; String normalizedPhone = stripCharsInBag ( s , phoneNumberDelimiters ) ; return ( isInteger ( normalizedPhone ) && normalizedPhone . length ( ) == digitsInUSPhoneNumber ) ; } | isUSPhoneNumber returns true if string s is a valid U . S . Phone Number . Must be 10 digits . |
34,009 | public static boolean isUSPhoneAreaCode ( String s ) { if ( isEmpty ( s ) ) return defaultEmptyOK ; String normalizedPhone = stripCharsInBag ( s , phoneNumberDelimiters ) ; return ( isInteger ( normalizedPhone ) && normalizedPhone . length ( ) == digitsInUSPhoneAreaCode ) ; } | isUSPhoneAreaCode returns true if string s is a valid U . S . Phone Area Code . Must be 3 digits . |
34,010 | public static boolean isUSPhoneMainNumber ( String s ) { if ( isEmpty ( s ) ) return defaultEmptyOK ; String normalizedPhone = stripCharsInBag ( s , phoneNumberDelimiters ) ; return ( isInteger ( normalizedPhone ) && normalizedPhone . length ( ) == digitsInUSPhoneMainNumber ) ; } | isUSPhoneMainNumber returns true if string s is a valid U . S . Phone Main Number . Must be 7 digits . |
34,011 | public static boolean isInternationalPhoneNumber ( String s ) { if ( isEmpty ( s ) ) return defaultEmptyOK ; String normalizedPhone = stripCharsInBag ( s , phoneNumberDelimiters ) ; return isPositiveInteger ( normalizedPhone ) ; } | isInternationalPhoneNumber returns true if string s is a valid international phone number . Must be digits only ; any length OK . May be prefixed by + character . |
34,012 | public static boolean isZipCode ( String s ) { if ( isEmpty ( s ) ) return defaultEmptyOK ; String normalizedZip = stripCharsInBag ( s , ZipCodeDelimiters ) ; return ( isInteger ( normalizedZip ) && ( ( normalizedZip . length ( ) == digitsInZipCode1 ) || ( normalizedZip . length ( ) == digitsInZipCode2 ) ) ) ; } | isZIPCode returns true if string s is a valid U . S . ZIP code . Must be 5 or 9 digits only . |
34,013 | public static boolean isContiguousZipCode ( String s ) { boolean retval = false ; if ( isZipCode ( s ) ) { if ( isEmpty ( s ) ) retval = defaultEmptyOK ; else { String normalizedZip = s . substring ( 0 , 5 ) ; int iZip = Integer . parseInt ( normalizedZip ) ; if ( ( iZip >= 96701 && iZip <= 96898 ) || ( iZip >= 99501 &... | Returns true if string s is a valid contiguous U . S . Zip code . Must be 5 or 9 digits only . |
34,014 | public static boolean isEmail ( String s ) { if ( isEmpty ( s ) ) return defaultEmptyOK ; if ( isWhitespace ( s ) ) return false ; int i = 1 ; int sLength = s . length ( ) ; while ( ( i < sLength ) && ( s . charAt ( i ) != '@' ) ) i ++ ; if ( ( i >= sLength - 1 ) || ( s . charAt ( i ) != '@' ) ) return false ; else ret... | Email address must be of form a |
34,015 | public static boolean isYear ( String s ) { if ( isEmpty ( s ) ) return defaultEmptyOK ; if ( ! isNonnegativeInteger ( s ) ) return false ; return ( ( s . length ( ) == 2 ) || ( s . length ( ) == 4 ) ) ; } | isYear returns true if string s is a valid Year number . Must be 2 or 4 digits only . |
34,016 | public static boolean isIntegerInRange ( String s , int a , int b ) { if ( isEmpty ( s ) ) return defaultEmptyOK ; if ( ! isSignedInteger ( s ) ) return false ; int num = Integer . parseInt ( s ) ; return ( ( num >= a ) && ( num <= b ) ) ; } | isIntegerInRange returns true if string s is an integer within the range of integer arguments a and b inclusive . |
34,017 | public static boolean isDate ( String year , String month , String day ) { if ( ! ( isYear ( year ) && isMonth ( month ) && isDay ( day ) ) ) return false ; int intYear = Integer . parseInt ( year ) ; int intMonth = Integer . parseInt ( month ) ; int intDay = Integer . parseInt ( day ) ; if ( intDay > daysInMonth [ int... | isDate returns true if string arguments year month and day form a valid date . |
34,018 | public static boolean isDate ( String date ) { if ( isEmpty ( date ) ) return defaultEmptyOK ; String month ; String day ; String year ; int dateSlash1 = date . indexOf ( "/" ) ; int dateSlash2 = date . lastIndexOf ( "/" ) ; if ( dateSlash1 <= 0 || dateSlash1 == dateSlash2 ) return false ; month = date . substring ( 0 ... | isDate returns true if string argument date forms a valid date . |
34,019 | public static boolean isDateAfterToday ( String date ) { if ( isEmpty ( date ) ) return defaultEmptyOK ; int dateSlash1 = date . indexOf ( "/" ) ; int dateSlash2 = date . lastIndexOf ( "/" ) ; if ( dateSlash1 <= 0 ) return false ; java . util . Date passed = null ; if ( dateSlash1 == dateSlash2 ) { String month = date ... | isDate returns true if string argument date forms a valid date and is after today . |
34,020 | public static boolean isTime ( String hour , String minute , String second ) { if ( isHour ( hour ) && isMinute ( minute ) && isSecond ( second ) ) return true ; else return false ; } | isTime returns true if string arguments hour minute and second form a valid time . |
34,021 | public static boolean isTime ( String time ) { if ( isEmpty ( time ) ) return defaultEmptyOK ; String hour ; String minute ; String second ; int timeColon1 = time . indexOf ( ":" ) ; int timeColon2 = time . lastIndexOf ( ":" ) ; if ( timeColon1 <= 0 ) return false ; hour = time . substring ( 0 , timeColon1 ) ; if ( tim... | isTime returns true if string argument time forms a valid time . |
34,022 | public static boolean isCreditCard ( String stPassed ) { if ( isEmpty ( stPassed ) ) return defaultEmptyOK ; String st = stripCharsInBag ( stPassed , creditCardDelimiters ) ; int sum = 0 ; int mul = 1 ; int l = st . length ( ) ; if ( l > 19 ) return ( false ) ; for ( int i = 0 ; i < l ; i ++ ) { String digit = st . sub... | Checks credit card number with Luhn Mod - 10 test |
34,023 | public static boolean isVisa ( String cc ) { if ( ( ( cc . length ( ) == 16 ) || ( cc . length ( ) == 13 ) ) && ( cc . substring ( 0 , 1 ) . equals ( "4" ) ) ) return isCreditCard ( cc ) ; return false ; } | Checks to see if the cc number is a valid Visa number |
34,024 | public static boolean isMasterCard ( String cc ) { int firstdig = Integer . parseInt ( cc . substring ( 0 , 1 ) ) ; int seconddig = Integer . parseInt ( cc . substring ( 1 , 2 ) ) ; if ( ( cc . length ( ) == 16 ) && ( firstdig == 5 ) && ( ( seconddig >= 1 ) && ( seconddig <= 5 ) ) ) return isCreditCard ( cc ) ; return ... | Checks to see if the cc number is a valid Master Card number |
34,025 | public static boolean isDiscover ( String cc ) { String first4digs = cc . substring ( 0 , 4 ) ; if ( ( cc . length ( ) == 16 ) && ( first4digs . equals ( "6011" ) ) ) return isCreditCard ( cc ) ; return false ; } | Checks to see if the cc number is a valid Discover number |
34,026 | public static boolean isJCB ( String cc ) { String first4digs = cc . substring ( 0 , 4 ) ; if ( ( cc . length ( ) == 16 ) && ( first4digs . equals ( "3088" ) || first4digs . equals ( "3096" ) || first4digs . equals ( "3112" ) || first4digs . equals ( "3158" ) || first4digs . equals ( "3337" ) || first4digs . equals ( "... | Checks to see if the cc number is a valid JCB number |
34,027 | public static boolean isAnyCard ( String ccPassed ) { if ( isEmpty ( ccPassed ) ) return defaultEmptyOK ; String cc = stripCharsInBag ( ccPassed , creditCardDelimiters ) ; if ( ! isCreditCard ( cc ) ) return false ; if ( isMasterCard ( cc ) || isVisa ( cc ) || isAmericanExpress ( cc ) || isDinersClub ( cc ) || isDiscov... | Checks to see if the cc number is a valid number for any accepted credit card |
34,028 | public static String getCardType ( String ccPassed ) { if ( isEmpty ( ccPassed ) ) return "Unknown" ; String cc = stripCharsInBag ( ccPassed , creditCardDelimiters ) ; if ( ! isCreditCard ( cc ) ) return "Unknown" ; if ( isMasterCard ( cc ) ) return "MasterCard" ; if ( isVisa ( cc ) ) return "Visa" ; if ( isAmericanExp... | Checks to see if the cc number is a valid number for any accepted credit card and return the name of that type |
34,029 | public static boolean isCardMatch ( String cardType , String cardNumberPassed ) { if ( isEmpty ( cardType ) ) return defaultEmptyOK ; if ( isEmpty ( cardNumberPassed ) ) return defaultEmptyOK ; String cardNumber = stripCharsInBag ( cardNumberPassed , creditCardDelimiters ) ; if ( ( cardType . equalsIgnoreCase ( "VISA" ... | Checks to see if the cc number is a valid number for the specified type |
34,030 | public static boolean isNotPoBox ( String s ) { if ( isEmpty ( s ) ) return defaultEmptyOK ; String sl = s . toLowerCase ( ) ; if ( sl . indexOf ( "p.o. b" ) != - 1 ) return false ; if ( sl . indexOf ( "p.o.b" ) != - 1 ) return false ; if ( sl . indexOf ( "p.o b" ) != - 1 ) return false ; if ( sl . indexOf ( "p o b" ) ... | isNotPoBox returns true if address argument does not contain anything that looks like a a PO Box . |
34,031 | public void process ( final String beanName , final HttpServletRequest request , final HttpServletResponse response ) throws ServletException , IOException { InputStream is = request . getInputStream ( ) ; OutputStream os = response . getOutputStream ( ) ; Hessian2Input in = new Hessian2Input ( is ) ; AbstractHessianOu... | Process servlet requests and writes bean s method result to output |
34,032 | public Map readHeaders ( Hessian2Input hessian2Input ) throws IOException { Map headers = new HashMap ( ) ; String header = hessian2Input . readHeader ( ) ; while ( header != null ) { headers . put ( header , hessian2Input . readObject ( ) ) ; header = hessian2Input . readHeader ( ) ; } return headers ; } | Reads headers from call . |
34,033 | protected void writeException ( final AbstractHessianOutput out , Exception ex ) throws IOException { OutputStream os = new ByteArrayOutputStream ( ) ; ex . printStackTrace ( new PrintStream ( os ) ) ; out . writeFault ( ex . getClass ( ) . toString ( ) , os . toString ( ) , null ) ; } | Writes Exception information to Hessian Output . |
34,034 | public Object getComponentNewInstance ( String name ) { Debug . logVerbose ( "[JdonFramework]getComponentNewInstance: name=" + name , module ) ; ComponentAdapter componentAdapter = container . getComponentAdapter ( name ) ; if ( componentAdapter == null ) { Debug . logWarning ( "[JdonFramework]Not find the component in... | This method will usually create a new instance each time it is called |
34,035 | public ModelHandler borrowtHandlerObject ( String formName ) { ModelHandler modelHandler = null ; try { modelHandler = handlerObjectFactory . borrowHandlerObject ( formName ) ; modelHandler . setModelMapping ( modelFactory . getModelMapping ( formName ) ) ; } catch ( Exception ex ) { Debug . logError ( "[JdonFramework]... | borrow a Handler instance from Modelhandler pool |
34,036 | public void returnHandlerObject ( ModelHandler modelHandler ) { if ( modelHandler == null ) return ; try { handlerObjectFactory . returnHandlerObject ( modelHandler ) ; } catch ( Exception ex ) { Debug . logError ( "[JdonFramework] return modelHandler error" + ex , module ) ; } } | return the Handler instance . |
34,037 | private Object makeModelObject ( String formName ) { Object object = null ; Class modelClass = null ; try { modelClass = ( Class ) modelFactory . getModelClasses ( formName ) ; if ( modelClass == null ) { throw new Exception ( " not found the model in config xml, formName=" + formName ) ; } object = modelClass . newIns... | create model instance from the model class that read from the xml configure . |
34,038 | public boolean hasNext ( ) { if ( currentIndex == endIndex ) { return false ; } if ( nextElement == null ) { nextElement = getNextElement ( ) ; if ( nextElement == null ) { return false ; } } return true ; } | Returns true if there are more elements in the iteration . |
34,039 | public Object next ( ) throws java . util . NoSuchElementException { Object element = null ; if ( nextElement != null ) { element = nextElement ; nextElement = null ; } else { element = getNextElement ( ) ; if ( element == null ) { throw new java . util . NoSuchElementException ( ) ; } } return element ; } | Returns the next element of primary key collection . |
34,040 | public boolean hasPrevious ( ) { if ( currentIndex == startIndex ) { return false ; } if ( previousElement == null ) { previousElement = getPreviousElement ( ) ; if ( previousElement == null ) { return false ; } } return true ; } | Returns true if there are previous elements in the iteration . |
34,041 | private Object getPreviousElement ( ) { Object element = null ; while ( currentIndex >= startIndex && element == null ) { currentIndex -- ; element = getElement ( ) ; } return element ; } | Returns the previous element or null if there are no more elements to return . |
34,042 | public Object getNextElement ( ) { Object element = null ; while ( currentIndex + 1 < endIndex && element == null ) { currentIndex ++ ; element = getElement ( ) ; } return element ; } | Returns the next available element of primary key collection or null if there are no more elements to return . |
34,043 | protected void emitWhitespace ( ) throws SAXException { char [ ] data = new char [ whitespace . length ( ) ] ; whitespace . getChars ( 0 , data . length , data , 0 ) ; whitespace . setLength ( 0 ) ; super . characters ( data , 0 , data . length ) ; } | Passes saved whitespace down the filter chain . |
34,044 | public String getKey ( ) { StringBuilder buffer = new StringBuilder ( cacheType ) ; buffer . append ( dataTypeName ) ; if ( dataKey != null ) buffer . append ( dataKey . toString ( ) ) ; return buffer . toString ( ) . intern ( ) ; } | cacheType + dataTypeName + dataKey |
34,045 | public void startElement ( String uri , String localName ) throws SAXException { startElement ( uri , localName , "" , EMPTY_ATTS ) ; } | Start a new element without a qname or attributes . |
34,046 | public void emptyElement ( String uri , String localName , String qName , Attributes atts ) throws SAXException { startElement ( uri , localName , qName , atts ) ; endElement ( uri , localName , qName ) ; } | Add an empty element . |
34,047 | public void emptyElement ( String uri , String localName ) throws SAXException { emptyElement ( uri , localName , "" , EMPTY_ATTS ) ; } | Add an empty element without a qname or attributes . |
34,048 | public void dataElement ( String uri , String localName , String qName , Attributes atts , String content ) throws SAXException { startElement ( uri , localName , qName , atts ) ; characters ( content ) ; endElement ( uri , localName , qName ) ; } | Add an element with character data content . |
34,049 | public void dataElement ( String uri , String localName , String content ) throws SAXException { dataElement ( uri , localName , "" , EMPTY_ATTS , content ) ; } | Add an element with character data content but no qname or attributes . |
34,050 | public void dataElement ( String localName , Attributes atts , String content ) throws SAXException { dataElement ( "" , localName , "" , atts , content ) ; } | Add an element with character data content but no Namespace URI or qname . |
34,051 | public void characters ( String data ) throws SAXException { char ch [ ] = data . toCharArray ( ) ; characters ( ch , 0 , ch . length ) ; } | Add a string of character data with XML escaping . |
34,052 | private void installLexicalHandler ( ) { XMLReader parent = getParent ( ) ; if ( parent == null ) { throw new NullPointerException ( "No parent for filter" ) ; } for ( int i = 0 ; i < LEXICAL_HANDLER_NAMES . length ; i ++ ) { try { parent . setProperty ( LEXICAL_HANDLER_NAMES [ i ] , this ) ; break ; } catch ( SAXNotRe... | Installs lexical handler before a parse . |
34,053 | public synchronized ContainerRegistryBuilder createContainerBuilder ( AppContextWrapper context ) { containerLoaderAnnotation . startScan ( context ) ; ContainerFactory containerFactory = new ContainerFactory ( ) ; ContainerWrapper cw = containerFactory . create ( containerLoaderAnnotation . getConfigInfo ( ) ) ; Conta... | the main method in this class read all components include interceptors from Xml configure file . |
34,054 | private static Class < ? > getHibernateClass ( ) { Class < ? > cl = null ; try { cl = Class . forName ( HIBERNATE_CLASS ) ; } catch ( ClassNotFoundException e ) { } return cl ; } | Return Hibernate class instance |
34,055 | private static Method getInitializeMethod ( Class < ? > cl ) { Method method = null ; try { method = cl . getDeclaredMethod ( IS_INITIALIZED , new Class [ ] { Object . class } ) ; } catch ( NoSuchMethodException e ) { } return method ; } | Return isInitialized Hibernate static method |
34,056 | private static boolean checkInitialize ( Method method , Object obj ) { boolean isInitialized = true ; try { isInitialized = ( Boolean ) method . invoke ( null , new Object [ ] { obj } ) ; } catch ( IllegalArgumentException e ) { } catch ( IllegalAccessException e ) { } catch ( InvocationTargetException e ) { } return ... | Check is current property was initialized |
34,057 | public static boolean isPropertyInitialized ( Object object ) { Class < ? > cl = getHibernateClass ( ) ; if ( cl == null ) { return true ; } Method method = getInitializeMethod ( cl ) ; return checkInitialize ( method , object ) ; } | Check is current object was initialized |
34,058 | public void registerAppRoot ( String configureFileName ) throws Exception { try { AppConfigureCollection existedAppConfigureFiles = ( AppConfigureCollection ) containerWrapper . lookup ( AppConfigureCollection . NAME ) ; if ( existedAppConfigureFiles == null ) { xmlcontainerRegistry . registerAppRoot ( ) ; existedAppCo... | if there are xml configure then add new ones ; if not register it ; |
34,059 | public void registerComponents ( ) throws Exception { Debug . logVerbose ( "[JdonFramework] note: registe all basic components in container.xml size=" + basicComponents . size ( ) , module ) ; try { Iterator iter = basicComponents . iterator ( ) ; while ( iter . hasNext ( ) ) { String name = ( String ) iter . next ( ) ... | register all basic components in container . xml |
34,060 | public void registerAspectComponents ( ) throws Exception { Debug . logVerbose ( "[JdonFramework] note: registe aspect components " , module ) ; try { InterceptorsChain existedInterceptorsChain = ( InterceptorsChain ) containerWrapper . lookup ( ComponentKeys . INTERCEPTOR_CHAIN ) ; Iterator iter = aspectConfigComponen... | register all apsect components in aspect . xml |
34,061 | public static void createFile ( String output , String content ) throws Exception { OutputStreamWriter fw = null ; PrintWriter out = null ; try { if ( ENCODING == null ) ENCODING = PropsUtil . ENCODING ; fw = new OutputStreamWriter ( new FileOutputStream ( output ) , ENCODING ) ; out = new PrintWriter ( fw ) ; out . pr... | write the content to a file ; |
34,062 | public static String readFile ( String input ) throws Exception { char [ ] buffer = new char [ 4096 ] ; int len = 0 ; StringBuilder content = new StringBuilder ( 4096 ) ; if ( ENCODING == null ) ENCODING = PropsUtil . ENCODING ; InputStreamReader fr = null ; BufferedReader br = null ; try { fr = new InputStreamReader (... | read the content from a file ; |
34,063 | public static void move ( String input , String output ) throws Exception { File inputFile = new File ( input ) ; File outputFile = new File ( output ) ; try { inputFile . renameTo ( outputFile ) ; } catch ( Exception ex ) { throw new Exception ( "Can not mv" + input + " to " + output + ex . getMessage ( ) ) ; } } | This class moves an input file to output file |
34,064 | public static boolean copy ( String input , String output ) throws Exception { int BUFSIZE = 65536 ; FileInputStream fis = new FileInputStream ( input ) ; FileOutputStream fos = new FileOutputStream ( output ) ; try { int s ; byte [ ] buf = new byte [ BUFSIZE ] ; while ( ( s = fis . read ( buf ) ) > - 1 ) { fos . write... | This class copies an input file to output file |
34,065 | public static void CopyDir ( String sourcedir , String destdir ) throws Exception { File dest = new File ( destdir ) ; File source = new File ( sourcedir ) ; String [ ] files = source . list ( ) ; try { makehome ( destdir ) ; } catch ( Exception ex ) { throw new Exception ( "CopyDir:" + ex . getMessage ( ) ) ; } for ( ... | This class copies an input files of a directory to another directory not include subdir |
34,066 | public static void recursiveRemoveDir ( File directory ) throws Exception { if ( ! directory . exists ( ) ) throw new IOException ( directory . toString ( ) + " do not exist!" ) ; String [ ] filelist = directory . list ( ) ; File tmpFile = null ; for ( int i = 0 ; i < filelist . length ; i ++ ) { tmpFile = new File ( d... | This class del a directory recursively that means delete all files and directorys . |
34,067 | public void createTargetMetaRequest ( TargetMetaDef targetMetaDef , ContextHolder holder ) { ContainerWrapper containerWrapper = servletContainerFinder . findContainer ( holder . getAppContextHolder ( ) ) ; VisitorFactory visitorFactory = ( VisitorFactory ) containerWrapper . lookup ( ComponentKeys . VISITOR_FACTORY ) ... | create a targetMetaRequest instance . |
34,068 | public Object getEventResult ( ) { Object result = eventResultCache . get ( ) ; if ( result != null ) { return result ; } if ( eventResultHandler != null ) { result = eventResultHandler . get ( ) ; if ( result != null ) { if ( ! eventResultCache . compareAndSet ( null , result ) ) { result = eventResultCache . get ( ) ... | get a Event Result until time out value |
34,069 | public Object visit ( ) { Object o = null ; try { ContainerWrapper containerWrapper = containerCallback . getContainerWrapper ( ) ; TargetMetaRequest targetMetaRequest = targetMetaRequestsHolder . getTargetMetaRequest ( ) ; Debug . logVerbose ( "[JdonFramework] ComponentOriginalVisitor active:" + targetMetaRequest . ge... | find the visitable component from container and execute it s accept method the return result is the tager service object . |
34,070 | public MethodMetaArgs createinitMethod ( HandlerMetaDef handlerMetaDef , EventModel em ) { String p_methodName = handlerMetaDef . getInitMethod ( ) ; if ( p_methodName == null ) return null ; return createCRUDMethodMetaArgs ( p_methodName , em ) ; } | create init method |
34,071 | public MethodMetaArgs createGetMethod ( HandlerMetaDef handlerMetaDef , Object keyValue ) { String p_methodName = handlerMetaDef . getFindMethod ( ) ; if ( p_methodName == null ) { Debug . logError ( "[JdonFramework] not configure the findMethod parameter: <getMethod name=XXXXX /> " , module ) ; } if ( keyValue == null... | create find method the service s find method parameter type must be String type |
34,072 | private void setSessionContext ( Object targetObject , TargetMetaRequest targetMetaRequest ) { if ( isSessionContextAcceptables . contains ( targetMetaRequest . getTargetMetaDef ( ) . getName ( ) ) ) { SessionContextAcceptable myResult = ( SessionContextAcceptable ) targetObject ; SessionContext sessionContext = target... | WebServiceAccessorImp create sessionContext and save infomation into it |
34,073 | public Object invoke ( TargetMetaDef targetMetaDef , Method m , Object [ ] args ) throws Throwable { Object result = null ; getThreadLock ( ) ; int currentRequestNb = requestNb ++ ; Debug . logVerbose ( "[JdonFramework]Start remote call " + currentRequestNb + " " + m . getName ( ) , module ) ; HttpRequest request = new... | Invokes EJB service |
34,074 | public Object invokeHttp ( HttpRequest request , Object [ ] args ) throws Throwable { HttpResponse httpResponse ; try { HttpConnectionHelper httpConnectionHelper = new HttpConnectionHelper ( ) ; HttpURLConnection httpURLConnection ; if ( httpServerParam . isDebug ( ) ) { Debug . logVerbose ( "[JdonFramework]connect ser... | Performs the http call . |
34,075 | private synchronized void getThreadLock ( ) { while ( sessionId == null && curUsedThread > 1 ) { try { Debug . logVerbose ( "No session. Only one thread is authorized. Waiting ..." , module ) ; wait ( ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } } while ( curUsedThread >= maxThreadCount ) { try ... | This method is used to limit the concurrent http call to the max fixed by maxThreadCount and to wait the end of the first call that will return the session id . |
34,076 | public Method createMethod ( TargetServiceFactory targetServiceFactory ) { Method method = null ; Debug . logVerbose ( "[JdonFramework] enter create the Method " , module ) ; try { TargetMetaRequest targetMetaRequest = targetMetaRequestsHolder . getTargetMetaRequest ( ) ; if ( targetMetaRequest . getTargetMetaDef ( ) .... | ejb s method creating must at first get service s EJB Object ; pojo s method creating can only need service s class . |
34,077 | public Method createPojoMethod ( ) { Method method = null ; TargetMetaRequest targetMetaRequest = targetMetaRequestsHolder . getTargetMetaRequest ( ) ; TargetMetaDef targetMetaDef = targetMetaRequest . getTargetMetaDef ( ) ; MethodMetaArgs methodMetaArgs = targetMetaRequest . getMethodMetaArgs ( ) ; Debug . logVerbose ... | create a method object by its meta definition |
34,078 | public Method createObjectMethod ( Object ownerClass , MethodMetaArgs methodMetaArgs ) { Method m = null ; try { m = ownerClass . getClass ( ) . getMethod ( methodMetaArgs . getMethodName ( ) , methodMetaArgs . getParamTypes ( ) ) ; } catch ( NoSuchMethodException nsme ) { String errS = " NoSuchMethod:" + methodMetaArg... | create a method object by target Object |
34,079 | public Method createObjectMethod ( Object ownerClass , String methodName , Class [ ] paramTypes ) { Method m = null ; try { m = ownerClass . getClass ( ) . getMethod ( methodName , paramTypes ) ; } catch ( NoSuchMethodException nsme ) { String errS = " NoSuchMethod:" + methodName + " in className:" + ownerClass . getCl... | create a method object |
34,080 | public InputStream getConfPathXmlStream ( String filePathName ) { int i = filePathName . lastIndexOf ( ".xml" ) ; String name = filePathName . substring ( 0 , i ) ; name = name . replace ( '.' , '/' ) ; name += ".xml" ; return getConfStream ( name ) ; } | same as getConfPathXmlFile |
34,081 | public Object put ( Object key , Object subKey , Object value ) { HashMap a = ( HashMap ) super . get ( key ) ; if ( a == null ) { a = new HashMap ( ) ; super . put ( key , a ) ; } return a . put ( subKey , value ) ; } | Associates the specified value with the specified key and subKey in this map . If the map previously contained a mapping for this key and subKey the old value is replaced . |
34,082 | public Object get ( Object key , Object subKey ) { HashMap a = ( HashMap ) super . get ( key ) ; if ( a != null ) { Object b = a . get ( subKey ) ; return b ; } return null ; } | Returns the value to which this map maps the specified key and subKey . Returns null if the map contains no mapping for this key and subKey . A return value of null does not necessarily indicate that the map contains no mapping for the key and subKey ; it s also possible that the map explicitly maps the key to null . T... |
34,083 | public void initialized ( AppContextWrapper context ) { ContainerRegistryBuilder cb = ( ContainerRegistryBuilder ) context . getAttribute ( ContainerRegistryBuilder . APPLICATION_CONTEXT_ATTRIBUTE_NAME ) ; if ( cb != null ) return ; try { synchronized ( context ) { cb = containerBuilderContext . createContainerBuilder ... | Initialize application container |
34,084 | public synchronized void prepare ( String configureFileName , AppContextWrapper context ) { ContainerRegistryBuilder cb ; try { cb = ( ContainerRegistryBuilder ) context . getAttribute ( ContainerRegistryBuilder . APPLICATION_CONTEXT_ATTRIBUTE_NAME ) ; if ( cb == null ) { initialized ( context ) ; cb = ( ContainerRegis... | prepare to the applicaition xml Configure for container ; |
34,085 | public synchronized void startup ( AppContextWrapper context ) { ContainerRegistryBuilder cb ; try { cb = ( ContainerRegistryBuilder ) context . getAttribute ( ContainerRegistryBuilder . APPLICATION_CONTEXT_ATTRIBUTE_NAME ) ; if ( cb == null ) { Debug . logError ( "[JdonFramework] at first call prepare method" ) ; retu... | startup Application container |
34,086 | public synchronized void destroyed ( AppContextWrapper context ) { try { ContainerRegistryBuilder cb = ( ContainerRegistryBuilder ) context . getAttribute ( ContainerRegistryBuilder . APPLICATION_CONTEXT_ATTRIBUTE_NAME ) ; if ( cb != null ) { ContainerDirector cd = new ContainerDirector ( cb ) ; cd . shutdown ( ) ; con... | desroy Application container |
34,087 | public static byte [ ] objectToBytes ( Object object ) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; ObjectOutputStream os = new ObjectOutputStream ( baos ) ; os . writeObject ( object ) ; return baos . toByteArray ( ) ; } | Converts a serializable object to a byte array . |
34,088 | public static Object bytesToObject ( byte [ ] bytes ) throws IOException , ClassNotFoundException { ByteArrayInputStream bais = new ByteArrayInputStream ( bytes ) ; ObjectInputStream is = new ObjectInputStream ( bais ) ; return is . readObject ( ) ; } | Converts a byte array to a serializable object . |
34,089 | private void parsePOJOServiceConfig ( Element pojoService , Map < String , TargetMetaDef > mps ) throws Exception { String name = pojoService . getAttributeValue ( "name" ) ; String className = pojoService . getAttributeValue ( "class" ) ; Debug . logVerbose ( "[JdonFramework] pojoService/component name=" + name + " cl... | parse POJOService Config |
34,090 | public EJBLocalHome getLocalHome ( String jndiHomeName ) throws ServiceLocatorException { Debug . logVerbose ( "[JdonFramework] -- > getLocalHome.... " , module ) ; EJBLocalHome home = null ; try { if ( cache . containsKey ( jndiHomeName ) ) { home = ( EJBLocalHome ) cache . get ( jndiHomeName ) ; } else { Debug . logV... | will get the ejb Local home factory . If this ejb home factory has already been clients need to cast to the type of EJBHome they desire |
34,091 | public Block locate ( String sqlquery , Collection queryParams , Object locateId ) { int blockSize = getBlockLength ( ) ; Block block = null ; int index = - 1 ; int prevBlockStart = Integer . MIN_VALUE ; int nextBlockStart = Integer . MIN_VALUE ; int start = 0 ; Debug . logVerbose ( "[JdonFramework]try to locate a bloc... | looking for the primary be equals to locateId in the result for the sql sentence . |
34,092 | private Block getBlock ( QueryConditonDatakey qcdk ) { Block clientBlock = new Block ( qcdk . getStart ( ) , qcdk . getCount ( ) ) ; if ( clientBlock . getCount ( ) > this . blockLength ) clientBlock . setCount ( this . blockLength ) ; List list = getBlockKeys ( qcdk ) ; Block dataBlock = new Block ( qcdk . getBlockSta... | get the current block being avaliable to the query condition |
34,093 | private List getBlockKeys ( QueryConditonDatakey qcdk ) { List keys = blockCacheManager . getBlockKeysFromCache ( qcdk ) ; if ( ( keys == null ) ) { keys = blockQueryJDBC . fetchDatas ( qcdk ) ; if ( keys != null && keys . size ( ) != 0 ) blockCacheManager . saveBlockKeys ( qcdk , keys ) ; } Debug . logVerbose ( "[Jdon... | get a Block that begin at the start |
34,094 | public static RequestWrapper create ( HttpServletRequest request ) { HttpSession session = request . getSession ( ) ; AppContextWrapper acw = new ServletContextWrapper ( session . getServletContext ( ) ) ; SessionWrapper sw = new HttpSessionWrapper ( session ) ; ContextHolder contextHolder = new ContextHolder ( acw , s... | create a HttpServletRequestWrapper with session supports . this method will create HttpSession . |
34,095 | public void setQueryParams ( Collection queryParams , PreparedStatement ps ) throws Exception { if ( ( queryParams == null ) || ( queryParams . size ( ) == 0 ) ) return ; int i = 1 ; Object key = null ; Iterator iter = queryParams . iterator ( ) ; while ( iter . hasNext ( ) ) { key = iter . next ( ) ; if ( key != null ... | queryParam type only support String Integer Float or Long Double Bye Short if you need operate other types you must use JDBC directly! |
34,096 | public List extract ( ResultSet rs ) throws Exception { ResultSetMetaData meta = rs . getMetaData ( ) ; int count = meta . getColumnCount ( ) ; List ret = new ArrayList ( ) ; while ( rs . next ( ) ) { Map map = new LinkedHashMap ( count ) ; for ( int i = 1 ; i <= count ; i ++ ) { map . put ( meta . getColumnName ( i ) ... | return a List in the List every object is a map by database column name we can get the its result from map |
34,097 | public Object invoke ( TargetMetaRequest targetMetaRequest , Method method , Object [ ] args ) throws Throwable { targetMetaRequestsHolder . setTargetMetaRequest ( targetMetaRequest ) ; Debug . logVerbose ( "[JdonFramework] enter AOP invoker2 for:" + targetMetaRequest . getTargetMetaDef ( ) . getClassName ( ) + " metho... | dynamic proxy active this method when client call userService . xxxmethod |
34,098 | @ Procedure ( mode = Mode . WRITE ) @ Description ( "apoc.refactor.rename.label(oldLabel, newLabel, [nodes]) | rename a label from 'oldLabel' to 'newLabel' for all nodes. If 'nodes' is provided renaming is applied to this set only" ) public Stream < BatchAndTotalResultWithInfo > label ( @ Name ( "oldLabel" ) String old... | Rename the Label of a node by creating a new one and deleting the old . |
34,099 | @ Procedure ( mode = Mode . WRITE ) @ Description ( "apoc.refactor.rename.type(oldType, newType, [rels]) | rename all relationships with type 'oldType' to 'newType'. If 'rels' is provided renaming is applied to this set only" ) public Stream < BatchAndTotalResultWithInfo > type ( @ Name ( "oldType" ) String oldType , @... | Rename the Relationship Type by creating a new one and deleting the old . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.