idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
28,100 | private static ClassLoader getBootstrapClassLoader ( ) { if ( BOOTSTRAP_CLASSLOADER == null ) { synchronized ( ClassLoaderUtil . class ) { if ( BOOTSTRAP_CLASSLOADER == null ) { ClassLoader cl = null ; if ( System . getSecurityManager ( ) != null ) { cl = AccessController . doPrivileged ( new PrivilegedAction < ClassLoader > ( ) { public BootstrapClassLoader run ( ) { return new BootstrapClassLoader ( ) ; } } ) ; } else { cl = new BootstrapClassLoader ( ) ; } BOOTSTRAP_CLASSLOADER = cl ; } } } return BOOTSTRAP_CLASSLOADER ; } | Lazily create a singleton BootstrapClassLoader . This class loader might be necessary when ICU4J classes are initialized by bootstrap class loader . |
28,101 | public static ClassLoader getClassLoader ( Class < ? > cls ) { ClassLoader cl = cls . getClassLoader ( ) ; if ( cl == null ) { cl = getClassLoader ( ) ; } return cl ; } | Returns the class loader used for loading the specified class . |
28,102 | public static ClassLoader getClassLoader ( ) { ClassLoader cl = Thread . currentThread ( ) . getContextClassLoader ( ) ; if ( cl == null ) { cl = ClassLoader . getSystemClassLoader ( ) ; if ( cl == null ) { cl = getBootstrapClassLoader ( ) ; } } return cl ; } | Returns a fallback class loader . |
28,103 | public void setSystemId ( String systemId ) { if ( null == inputSource ) { inputSource = new InputSource ( systemId ) ; } else { inputSource . setSystemId ( systemId ) ; } } | Set the system identifier for this Source . If an input source has already been set it will set the system ID or that input source otherwise it will create a new input source . |
28,104 | public static InputSource sourceToInputSource ( Source source ) { if ( source instanceof SAXSource ) { return ( ( SAXSource ) source ) . getInputSource ( ) ; } else if ( source instanceof StreamSource ) { StreamSource ss = ( StreamSource ) source ; InputSource isource = new InputSource ( ss . getSystemId ( ) ) ; isource . setByteStream ( ss . getInputStream ( ) ) ; isource . setCharacterStream ( ss . getReader ( ) ) ; isource . setPublicId ( ss . getPublicId ( ) ) ; return isource ; } else { return null ; } } | Attempt to obtain a SAX InputSource object from a Source object . |
28,105 | private void checkSunPKCS11Solaris ( ) { Boolean o = AccessController . doPrivileged ( new PrivilegedAction < Boolean > ( ) { public Boolean run ( ) { File file = new File ( "/usr/lib/libpkcs11.so" ) ; if ( file . exists ( ) == false ) { return Boolean . FALSE ; } if ( "false" . equalsIgnoreCase ( System . getProperty ( "sun.security.pkcs11.enable-solaris" ) ) ) { return Boolean . FALSE ; } return Boolean . TRUE ; } } ) ; if ( o == Boolean . FALSE ) { tries = MAX_LOAD_TRIES ; } } | or if disabled via system property |
28,106 | synchronized Provider getProvider ( ) { Provider p = provider ; if ( p != null ) { return p ; } if ( shouldLoad ( ) == false ) { return null ; } if ( isLoading ) { return null ; } try { isLoading = true ; tries ++ ; p = doLoadProvider ( ) ; } finally { isLoading = false ; } provider = p ; return p ; } | Get the provider object . Loads the provider if it is not already loaded . |
28,107 | private Provider doLoadProvider ( ) { return AccessController . doPrivileged ( new PrivilegedAction < Provider > ( ) { public Provider run ( ) { try { return initProvider ( className , Object . class . getClassLoader ( ) ) ; } catch ( Exception e1 ) { try { return initProvider ( className , ClassLoader . getSystemClassLoader ( ) ) ; } catch ( Exception e ) { Throwable t ; if ( e instanceof InvocationTargetException ) { t = ( ( InvocationTargetException ) e ) . getCause ( ) ; } else { t = e ; } if ( t instanceof ProviderException ) { throw ( ProviderException ) t ; } if ( t instanceof UnsupportedOperationException ) { disableLoad ( ) ; } return null ; } } } } ) ; } | Load and instantiate the Provider described by this class . |
28,108 | private static String expand ( final String value ) { if ( value . contains ( "${" ) == false ) { return value ; } try { return PropertyExpander . expand ( value ) ; } catch ( GeneralSecurityException e ) { throw new ProviderException ( e ) ; } } | Perform property expansion of the provider value . |
28,109 | void init ( TransformerFactoryImpl processor ) { m_stylesheetProcessor = processor ; m_processors . push ( m_schema . getElementProcessor ( ) ) ; this . pushNewNamespaceSupport ( ) ; } | Do common initialization . |
28,110 | public XPath createXPath ( String str , ElemTemplateElement owningTemplate ) throws javax . xml . transform . TransformerException { ErrorListener handler = m_stylesheetProcessor . getErrorListener ( ) ; XPath xpath = new XPath ( str , owningTemplate , this , XPath . SELECT , handler , m_funcTable ) ; xpath . callVisitors ( xpath , new ExpressionVisitor ( getStylesheetRoot ( ) ) ) ; return xpath ; } | Process an expression string into an XPath . Must be public for access by the AVT class . |
28,111 | private boolean stackContains ( Stack stack , String url ) { int n = stack . size ( ) ; boolean contains = false ; for ( int i = 0 ; i < n ; i ++ ) { String url2 = ( String ) stack . elementAt ( i ) ; if ( url2 . equals ( url ) ) { contains = true ; break ; } } return contains ; } | Utility function to see if the stack contains the given URL . |
28,112 | XSLTElementProcessor getProcessorFor ( String uri , String localName , String rawName ) throws org . xml . sax . SAXException { XSLTElementProcessor currentProcessor = getCurrentProcessor ( ) ; XSLTElementDef def = currentProcessor . getElemDef ( ) ; XSLTElementProcessor elemProcessor = def . getProcessorFor ( uri , localName ) ; if ( null == elemProcessor && ! ( currentProcessor instanceof ProcessorStylesheetDoc ) && ( ( null == getStylesheet ( ) || Double . valueOf ( getStylesheet ( ) . getVersion ( ) ) . doubleValue ( ) > Constants . XSLTVERSUPPORTED ) || ( ! uri . equals ( Constants . S_XSLNAMESPACEURL ) && currentProcessor instanceof ProcessorStylesheetElement ) || getElemVersion ( ) > Constants . XSLTVERSUPPORTED ) ) { elemProcessor = def . getProcessorForUnknown ( uri , localName ) ; } if ( null == elemProcessor ) error ( XSLMessages . createMessage ( XSLTErrorResources . ER_NOT_ALLOWED_IN_POSITION , new Object [ ] { rawName } ) , null ) ; return elemProcessor ; } | Given a namespace URI and a local name or a node type get the processor for the element or return null if not allowed . |
28,113 | private void flushCharacters ( ) throws org . xml . sax . SAXException { XSLTElementProcessor elemProcessor = getCurrentProcessor ( ) ; if ( null != elemProcessor ) elemProcessor . startNonText ( this ) ; } | Flush the characters buffer . |
28,114 | public void skippedEntity ( String name ) throws org . xml . sax . SAXException { if ( ! m_shouldProcess ) return ; getCurrentProcessor ( ) . skippedEntity ( this , name ) ; } | Receive notification of a skipped entity . |
28,115 | public void warning ( org . xml . sax . SAXParseException e ) throws org . xml . sax . SAXException { String formattedMsg = e . getMessage ( ) ; SAXSourceLocator locator = getLocator ( ) ; ErrorListener handler = m_stylesheetProcessor . getErrorListener ( ) ; try { handler . warning ( new TransformerException ( formattedMsg , locator ) ) ; } catch ( TransformerException te ) { throw new org . xml . sax . SAXException ( te ) ; } } | Receive notification of a XSLT processing warning . |
28,116 | public StylesheetRoot getStylesheetRoot ( ) { if ( m_stylesheetRoot != null ) { m_stylesheetRoot . setOptimizer ( m_optimize ) ; m_stylesheetRoot . setIncremental ( m_incremental ) ; m_stylesheetRoot . setSource_location ( m_source_location ) ; } return m_stylesheetRoot ; } | Return the stylesheet root that this handler is constructing . |
28,117 | public void pushStylesheet ( Stylesheet s ) { if ( m_stylesheets . size ( ) == 0 ) m_stylesheetRoot = ( StylesheetRoot ) s ; m_stylesheets . push ( s ) ; } | Push the current stylesheet being constructed . If no other stylesheets have been pushed onto the stack assume the argument is a stylesheet root and also set the stylesheet root member . |
28,118 | Stylesheet popStylesheet ( ) { if ( ! m_stylesheetLocatorStack . isEmpty ( ) ) m_stylesheetLocatorStack . pop ( ) ; if ( ! m_stylesheets . isEmpty ( ) ) m_lastPoppedStylesheet = ( Stylesheet ) m_stylesheets . pop ( ) ; return m_lastPoppedStylesheet ; } | Pop the last stylesheet pushed and return the stylesheet that this handler is constructing and set the last popped stylesheet member . Also pop the stylesheet locator stack . |
28,119 | ElemTemplateElement getElemTemplateElement ( ) { try { return ( ElemTemplateElement ) m_elems . peek ( ) ; } catch ( java . util . EmptyStackException ese ) { return null ; } } | Get the current ElemTemplateElement at the top of the stack . |
28,120 | void pushBaseIndentifier ( String baseID ) { if ( null != baseID ) { int posOfHash = baseID . indexOf ( '#' ) ; if ( posOfHash > - 1 ) { m_fragmentIDString = baseID . substring ( posOfHash + 1 ) ; m_shouldProcess = false ; } else m_shouldProcess = true ; } else m_shouldProcess = true ; m_baseIdentifiers . push ( baseID ) ; } | Push a base identifier onto the base URI stack . |
28,121 | public String getBaseIdentifier ( ) { String base = ( String ) ( m_baseIdentifiers . isEmpty ( ) ? null : m_baseIdentifiers . peek ( ) ) ; if ( null == base ) { SourceLocator locator = getLocator ( ) ; base = ( null == locator ) ? "" : locator . getSystemId ( ) ; } return base ; } | Return the base identifier . |
28,122 | public SAXSourceLocator getLocator ( ) { if ( m_stylesheetLocatorStack . isEmpty ( ) ) { SAXSourceLocator locator = new SAXSourceLocator ( ) ; locator . setSystemId ( this . getStylesheetProcessor ( ) . getDOMsystemID ( ) ) ; return locator ; } return ( ( SAXSourceLocator ) m_stylesheetLocatorStack . peek ( ) ) ; } | Get the current stylesheet Locator object . |
28,123 | public ArrayList < ProgressSource > getProgressSources ( ) { ArrayList < ProgressSource > snapshot = new ArrayList < ProgressSource > ( ) ; try { synchronized ( progressSourceList ) { for ( Iterator < ProgressSource > iter = progressSourceList . iterator ( ) ; iter . hasNext ( ) ; ) { ProgressSource pi = iter . next ( ) ; snapshot . add ( ( ProgressSource ) pi . clone ( ) ) ; } } } catch ( CloneNotSupportedException e ) { e . printStackTrace ( ) ; } return snapshot ; } | Return a snapshot of the ProgressSource list |
28,124 | public void registerSource ( ProgressSource pi ) { synchronized ( progressSourceList ) { if ( progressSourceList . contains ( pi ) ) return ; progressSourceList . add ( pi ) ; } if ( progressListenerList . size ( ) > 0 ) { ArrayList < ProgressListener > listeners = new ArrayList < ProgressListener > ( ) ; synchronized ( progressListenerList ) { for ( Iterator < ProgressListener > iter = progressListenerList . iterator ( ) ; iter . hasNext ( ) ; ) { listeners . add ( iter . next ( ) ) ; } } for ( Iterator < ProgressListener > iter = listeners . iterator ( ) ; iter . hasNext ( ) ; ) { ProgressListener pl = iter . next ( ) ; ProgressEvent pe = new ProgressEvent ( pi , pi . getURL ( ) , pi . getMethod ( ) , pi . getContentType ( ) , pi . getState ( ) , pi . getProgress ( ) , pi . getExpected ( ) ) ; pl . progressStart ( pe ) ; } } } | Register progress source when progress is began . |
28,125 | public void put ( String hostname , int netId , InetAddress [ ] addresses ) { cache . put ( new AddressCacheKey ( hostname , netId ) , new AddressCacheEntry ( addresses ) ) ; } | Associates the given addresses with hostname . The association will expire after a certain length of time . |
28,126 | private byte [ ] maybeDecodeBase64 ( byte [ ] byteArray ) { try { String pem = new String ( byteArray ) ; pem = pem . substring ( BEGIN_CERT_LINE_LENGTH , pem . length ( ) - END_CERT_LINE_LENGTH ) ; return Base64 . getDecoder ( ) . decode ( pem ) ; } catch ( Exception e ) { return byteArray ; } } | Test whether array is a Base64 - encoded certificate . If so return the decoded content instead of the specified array . |
28,127 | public static void readFully ( InputStream in , byte [ ] dst ) throws IOException { readFully ( in , dst , 0 , dst . length ) ; } | Fills dst with bytes from in throwing EOFException if insufficient bytes are available . |
28,128 | public static String readFully ( Reader reader ) throws IOException { try { StringWriter writer = new StringWriter ( ) ; char [ ] buffer = new char [ 1024 ] ; int count ; while ( ( count = reader . read ( buffer ) ) != - 1 ) { writer . write ( buffer , 0 , count ) ; } return writer . toString ( ) ; } finally { reader . close ( ) ; } } | Returns the remainder of reader as a string closing it when done . |
28,129 | public static int getOptions ( CollationData data , CollationSettings settings , char [ ] primaries ) { char [ ] header = data . fastLatinTableHeader ; if ( header == null ) { return - 1 ; } assert ( ( header [ 0 ] >> 8 ) == VERSION ) ; if ( primaries . length != LATIN_LIMIT ) { assert false ; return - 1 ; } int miniVarTop ; if ( ( settings . options & CollationSettings . ALTERNATE_MASK ) == 0 ) { miniVarTop = MIN_LONG - 1 ; } else { int headerLength = header [ 0 ] & 0xff ; int i = 1 + settings . getMaxVariable ( ) ; if ( i >= headerLength ) { return - 1 ; } miniVarTop = header [ i ] ; } boolean digitsAreReordered = false ; if ( settings . hasReordering ( ) ) { long prevStart = 0 ; long beforeDigitStart = 0 ; long digitStart = 0 ; long afterDigitStart = 0 ; for ( int group = Collator . ReorderCodes . FIRST ; group < Collator . ReorderCodes . FIRST + CollationData . MAX_NUM_SPECIAL_REORDER_CODES ; ++ group ) { long start = data . getFirstPrimaryForGroup ( group ) ; start = settings . reorder ( start ) ; if ( group == Collator . ReorderCodes . DIGIT ) { beforeDigitStart = prevStart ; digitStart = start ; } else if ( start != 0 ) { if ( start < prevStart ) { return - 1 ; } if ( digitStart != 0 && afterDigitStart == 0 && prevStart == beforeDigitStart ) { afterDigitStart = start ; } prevStart = start ; } } long latinStart = data . getFirstPrimaryForGroup ( UScript . LATIN ) ; latinStart = settings . reorder ( latinStart ) ; if ( latinStart < prevStart ) { return - 1 ; } if ( afterDigitStart == 0 ) { afterDigitStart = latinStart ; } if ( ! ( beforeDigitStart < digitStart && digitStart < afterDigitStart ) ) { digitsAreReordered = true ; } } char [ ] table = data . fastLatinTable ; for ( int c = 0 ; c < LATIN_LIMIT ; ++ c ) { int p = table [ c ] ; if ( p >= MIN_SHORT ) { p &= SHORT_PRIMARY_MASK ; } else if ( p > miniVarTop ) { p &= LONG_PRIMARY_MASK ; } else { p = 0 ; } primaries [ c ] = ( char ) p ; } if ( digitsAreReordered || ( settings . options & CollationSettings . NUMERIC ) != 0 ) { for ( int c = 0x30 ; c <= 0x39 ; ++ c ) { primaries [ c ] = 0 ; } } return ( miniVarTop << 16 ) | settings . options ; } | Computes the options value for the compare functions and writes the precomputed primary weights . Returns - 1 if the Latin fastpath is not supported for the data and settings . The capacity must be LATIN_LIMIT . |
28,130 | protected Class < ? > loadClass ( String name , boolean resolve ) throws ClassNotFoundException { Class < ? > c = findLoadedClass ( name ) ; if ( c == null ) { try { if ( parent != null ) { c = parent . loadClass ( name , false ) ; } else { c = findBootstrapClassOrNull ( name ) ; } } catch ( ClassNotFoundException e ) { } if ( c == null ) { c = findClass ( name ) ; } } return c ; } | during the entire class loading process . |
28,131 | private void readObject ( ObjectInputStream s ) throws IOException , ClassNotFoundException , InvalidObjectException { s . defaultReadObject ( ) ; if ( minSmallest > minLargest ) { throw new InvalidObjectException ( "Smallest minimum value must be less than largest minimum value" ) ; } if ( maxSmallest > maxLargest ) { throw new InvalidObjectException ( "Smallest maximum value must be less than largest maximum value" ) ; } if ( minLargest > maxLargest ) { throw new InvalidObjectException ( "Minimum value must be less than maximum value" ) ; } } | Restore the state of an ValueRange from the stream . Check that the values are valid . |
28,132 | public String getPropertyName ( int property , int nameChoice ) { int valueMapIndex = findProperty ( property ) ; if ( valueMapIndex == 0 ) { throw new IllegalArgumentException ( "Invalid property enum " + property + " (0x" + Integer . toHexString ( property ) + ")" ) ; } return getName ( valueMaps [ valueMapIndex ] , nameChoice ) ; } | Returns a property name given a property enum . Multiple names may be available for each property ; the nameChoice selects among them . |
28,133 | public String getPropertyValueName ( int property , int value , int nameChoice ) { int valueMapIndex = findProperty ( property ) ; if ( valueMapIndex == 0 ) { throw new IllegalArgumentException ( "Invalid property enum " + property + " (0x" + Integer . toHexString ( property ) + ")" ) ; } int nameGroupOffset = findPropertyValueNameGroup ( valueMaps [ valueMapIndex + 1 ] , value ) ; if ( nameGroupOffset == 0 ) { throw new IllegalArgumentException ( "Property " + property + " (0x" + Integer . toHexString ( property ) + ") does not have named values" ) ; } return getName ( nameGroupOffset , nameChoice ) ; } | Returns a value name given a property enum and a value enum . Multiple names may be available for each value ; the nameChoice selects among them . |
28,134 | public int getPropertyValueEnum ( int property , CharSequence alias ) { int valueMapIndex = findProperty ( property ) ; if ( valueMapIndex == 0 ) { throw new IllegalArgumentException ( "Invalid property enum " + property + " (0x" + Integer . toHexString ( property ) + ")" ) ; } valueMapIndex = valueMaps [ valueMapIndex + 1 ] ; if ( valueMapIndex == 0 ) { throw new IllegalArgumentException ( "Property " + property + " (0x" + Integer . toHexString ( property ) + ") does not have named values" ) ; } return getPropertyOrValueEnum ( valueMaps [ valueMapIndex ] , alias ) ; } | Returns a value enum given a property enum and one of its value names . |
28,135 | public int getPropertyValueEnumNoThrow ( int property , CharSequence alias ) { int valueMapIndex = findProperty ( property ) ; if ( valueMapIndex == 0 ) { return UProperty . UNDEFINED ; } valueMapIndex = valueMaps [ valueMapIndex + 1 ] ; if ( valueMapIndex == 0 ) { return UProperty . UNDEFINED ; } return getPropertyOrValueEnum ( valueMaps [ valueMapIndex ] , alias ) ; } | Returns a value enum given a property enum and one of its value names . Does not throw . |
28,136 | public String next ( ) throws IOException { if ( done ) { return null ; } for ( ; ; ) { if ( line == null ) { line = reader . readLineSkippingComments ( ) ; if ( line == null ) { done = true ; return null ; } pos = 0 ; } buf . setLength ( 0 ) ; lastpos = pos ; pos = nextToken ( pos ) ; if ( pos < 0 ) { line = null ; continue ; } return buf . toString ( ) ; } } | Return the next token from this iterator or null if the last token has been returned . |
28,137 | public final long nextCE ( ) { if ( cesIndex < ceBuffer . length ) { return ceBuffer . get ( cesIndex ++ ) ; } assert cesIndex == ceBuffer . length ; ceBuffer . incLength ( ) ; long cAndCE32 = handleNextCE32 ( ) ; int c = ( int ) ( cAndCE32 >> 32 ) ; int ce32 = ( int ) cAndCE32 ; int t = ce32 & 0xff ; if ( t < Collation . SPECIAL_CE32_LOW_BYTE ) { return ceBuffer . set ( cesIndex ++ , ( ( long ) ( ce32 & 0xffff0000 ) << 32 ) | ( ( long ) ( ce32 & 0xff00 ) << 16 ) | ( t << 8 ) ) ; } CollationData d ; if ( t == Collation . SPECIAL_CE32_LOW_BYTE ) { if ( c < 0 ) { return ceBuffer . set ( cesIndex ++ , Collation . NO_CE ) ; } d = data . base ; ce32 = d . getCE32 ( c ) ; t = ce32 & 0xff ; if ( t < Collation . SPECIAL_CE32_LOW_BYTE ) { return ceBuffer . set ( cesIndex ++ , ( ( long ) ( ce32 & 0xffff0000 ) << 32 ) | ( ( long ) ( ce32 & 0xff00 ) << 16 ) | ( t << 8 ) ) ; } } else { d = data ; } if ( t == Collation . LONG_PRIMARY_CE32_LOW_BYTE ) { return ceBuffer . set ( cesIndex ++ , ( ( long ) ( ce32 - t ) << 32 ) | Collation . COMMON_SEC_AND_TER_CE ) ; } return nextCEFromCE32 ( d , c , ce32 ) ; } | Returns the next collation element . |
28,138 | public final long previousCE ( UVector32 offsets ) { if ( ceBuffer . length > 0 ) { return ceBuffer . get ( -- ceBuffer . length ) ; } offsets . removeAllElements ( ) ; int limitOffset = getOffset ( ) ; int c = previousCodePoint ( ) ; if ( c < 0 ) { return Collation . NO_CE ; } if ( data . isUnsafeBackward ( c , isNumeric ) ) { return previousCEUnsafe ( c , offsets ) ; } int ce32 = data . getCE32 ( c ) ; CollationData d ; if ( ce32 == Collation . FALLBACK_CE32 ) { d = data . base ; ce32 = d . getCE32 ( c ) ; } else { d = data ; } if ( Collation . isSimpleOrLongCE32 ( ce32 ) ) { return Collation . ceFromCE32 ( ce32 ) ; } appendCEsFromCE32 ( d , c , ce32 , false ) ; if ( ceBuffer . length > 1 ) { offsets . addElement ( getOffset ( ) ) ; while ( offsets . size ( ) <= ceBuffer . length ) { offsets . addElement ( limitOffset ) ; } ; } return ceBuffer . get ( -- ceBuffer . length ) ; } | Returns the previous collation element . |
28,139 | public Object [ ] [ ] getContents ( ) { return new Object [ ] [ ] { { "ui_language" , "ja" } , { "help_language" , "ja" } , { "language" , "ja" } , { "alphabet" , new CharArrayWrapper ( new char [ ] { 0x30a4 , 0x30ed , 0x30cf , 0x30cb , 0x30db , 0x30d8 , 0x30c8 , 0x30c1 , 0x30ea , 0x30cc , 0x30eb , 0x30f2 , 0x30ef , 0x30ab , 0x30e8 , 0x30bf , 0x30ec , 0x30bd , 0x30c4 , 0x30cd , 0x30ca , 0x30e9 , 0x30e0 , 0x30a6 , 0x30f0 , 0x30ce , 0x30aa , 0x30af , 0x30e4 , 0x30de , 0x30b1 , 0x30d5 , 0x30b3 , 0x30a8 , 0x30c6 , 0x30a2 , 0x30b5 , 0x30ad , 0x30e6 , 0x30e1 , 0x30df , 0x30b7 , 0x30f1 , 0x30d2 , 0x30e2 , 0x30bb , 0x30b9 } ) } , { "tradAlphabet" , new CharArrayWrapper ( new char [ ] { 'A' , 'B' , 'C' , 'D' , 'E' , 'F' , 'G' , 'H' , 'I' , 'J' , 'K' , 'L' , 'M' , 'N' , 'O' , 'P' , 'Q' , 'R' , 'S' , 'T' , 'U' , 'V' , 'W' , 'X' , 'Y' , 'Z' } ) } , { "orientation" , "LeftToRight" } , { "numbering" , "multiplicative-additive" } , { "multiplierOrder" , "follows" } , { "numberGroups" , new IntArrayWrapper ( new int [ ] { 1 } ) } , { "multiplier" , new LongArrayWrapper ( new long [ ] { Long . MAX_VALUE , Long . MAX_VALUE , 100000000 , 10000 , 1000 , 100 , 10 } ) } , { "multiplierChar" , new CharArrayWrapper ( new char [ ] { 0x4EAC , 0x5146 , 0x5104 , 0x4E07 , 0x5343 , 0x767e , 0x5341 } ) } , { "zero" , new CharArrayWrapper ( new char [ 0 ] ) } , { "digits" , new CharArrayWrapper ( new char [ ] { 0x4E00 , 0x4E8C , 0x4E09 , 0x56DB , 0x4E94 , 0x516D , 0x4E03 , 0x516B , 0x4E5D } ) } , { "tables" , new StringArrayWrapper ( new String [ ] { "digits" } ) } } ; } | Get the association table for this resource . |
28,140 | public String getValueString ( ) { try { String s = value . getAsString ( ) ; if ( s == null ) { throw new RuntimeException ( "AVA string is null" ) ; } return s ; } catch ( IOException e ) { throw new RuntimeException ( "AVA error: " + e , e ) ; } } | Get the value of this AVA as a String . |
28,141 | static String getKeyword ( ObjectIdentifier oid , int standard ) { return getKeyword ( oid , standard , Collections . < String , String > emptyMap ( ) ) ; } | Get a keyword for the given ObjectIdentifier according to standard . If no keyword is available the ObjectIdentifier is encoded as a String . |
28,142 | static boolean hasKeyword ( ObjectIdentifier oid , int standard ) { AVAKeyword ak = oidMap . get ( oid ) ; if ( ak == null ) { return false ; } return ak . isCompliant ( standard ) ; } | Test if oid has an associated keyword in standard . |
28,143 | int specialFind ( int startPos , int position ) { int ancestor = startPos ; while ( ancestor > 0 ) { ancestor *= slotsize ; int chunkpos = ancestor >> lowbits ; int slotpos = ancestor & lowmask ; int [ ] chunk = chunks . elementAt ( chunkpos ) ; ancestor = chunk [ slotpos + 1 ] ; if ( ancestor == position ) break ; } if ( ancestor <= 0 ) { return position ; } return - 1 ; } | This test supports DTM . getNextPreceding . |
28,144 | void readSlot ( int position , int [ ] buffer ) { { position *= slotsize ; int chunkpos = position >> lowbits ; int slotpos = ( position & lowmask ) ; if ( chunkpos > chunks . size ( ) - 1 ) chunks . addElement ( new int [ chunkalloc ] ) ; int [ ] chunk = chunks . elementAt ( chunkpos ) ; System . arraycopy ( chunk , slotpos , buffer , 0 , slotsize ) ; } } | Retrieve the contents of a record into a user - supplied buffer array . Used to reduce addressing overhead when code will access several columns of the record . |
28,145 | private void fill ( ) throws IOException { byte [ ] buffer = getBufIfOpen ( ) ; if ( markpos < 0 ) pos = 0 ; else if ( pos >= buffer . length ) if ( markpos > 0 ) { int sz = pos - markpos ; System . arraycopy ( buffer , markpos , buffer , 0 , sz ) ; pos = sz ; markpos = 0 ; } else if ( buffer . length >= marklimit ) { markpos = - 1 ; pos = 0 ; } else if ( buffer . length >= MAX_BUFFER_SIZE ) { throw new OutOfMemoryError ( "Required array size too large" ) ; } else { int nsz = ( pos <= MAX_BUFFER_SIZE - pos ) ? pos * 2 : MAX_BUFFER_SIZE ; if ( nsz > marklimit ) nsz = marklimit ; byte nbuf [ ] = new byte [ nsz ] ; System . arraycopy ( buffer , 0 , nbuf , 0 , pos ) ; if ( ! compareAndSetBuf ( buffer , nbuf ) ) { throw new IOException ( "Stream closed" ) ; } buffer = nbuf ; } count = pos ; int n = getInIfOpen ( ) . read ( buffer , pos , buffer . length - pos ) ; if ( n > 0 ) count = n + pos ; } | Fills the buffer with more data taking into account shuffling and other tricks for dealing with marks . Assumes that it is being called by a synchronized method . This method also assumes that all data has already been read in hence pos > count . |
28,146 | public synchronized int read ( byte b [ ] , int off , int len ) throws IOException { getBufIfOpen ( ) ; if ( ( off | len | ( off + len ) | ( b . length - ( off + len ) ) ) < 0 ) { throw new IndexOutOfBoundsException ( ) ; } else if ( len == 0 ) { return 0 ; } int n = 0 ; for ( ; ; ) { int nread = read1 ( b , off + n , len - n ) ; if ( nread <= 0 ) return ( n == 0 ) ? nread : n ; n += nread ; if ( n >= len ) return n ; InputStream input = in ; if ( input != null && input . available ( ) <= 0 ) return n ; } } | Reads bytes from this byte - input stream into the specified byte array starting at the given offset . |
28,147 | static Runnable composeWithExceptions ( Runnable a , Runnable b ) { return new Runnable ( ) { public void run ( ) { try { a . run ( ) ; } catch ( Throwable e1 ) { try { b . run ( ) ; } catch ( Throwable e2 ) { try { e1 . addSuppressed ( e2 ) ; } catch ( Throwable ignore ) { } } throw e1 ; } b . run ( ) ; } } ; } | Given two Runnables return a Runnable that executes both in sequence even if the first throws an exception and if both throw exceptions add any exceptions thrown by the second as suppressed exceptions of the first . |
28,148 | public final Object handleGetObject ( String key ) { if ( lookup == null ) { loadLookup ( ) ; } if ( key == null ) { throw new NullPointerException ( ) ; } return lookup . get ( key ) ; } | Implements java . util . ResourceBundle . handleGetObject ; inherits javadoc specification . |
28,149 | private synchronized void loadLookup ( ) { if ( lookup != null ) return ; Object [ ] [ ] contents = getContents ( ) ; HashMap < String , Object > temp = new HashMap < > ( contents . length ) ; for ( int i = 0 ; i < contents . length ; ++ i ) { String key = ( String ) contents [ i ] [ 0 ] ; Object value = contents [ i ] [ 1 ] ; if ( key == null || value == null ) { throw new NullPointerException ( ) ; } temp . put ( key , value ) ; } lookup = temp ; } | We lazily load the lookup hashtable . This function does the loading . |
28,150 | public void update ( byte [ ] b , int off , int len ) { if ( b == null ) { throw new NullPointerException ( ) ; } if ( off < 0 || len < 0 || off > b . length - len ) { throw new ArrayIndexOutOfBoundsException ( ) ; } adler = updateBytes ( adler , b , off , len ) ; } | Updates the checksum with the specified array of bytes . |
28,151 | private void update ( ByteBuffer buffer ) { int pos = buffer . position ( ) ; int limit = buffer . limit ( ) ; assert ( pos <= limit ) ; int rem = limit - pos ; if ( rem <= 0 ) return ; if ( buffer instanceof DirectBuffer ) { adler = updateByteBuffer ( adler , ( ( DirectBuffer ) buffer ) . address ( ) , pos , rem ) ; } else if ( buffer . hasArray ( ) ) { adler = updateBytes ( adler , buffer . array ( ) , pos + buffer . arrayOffset ( ) , rem ) ; } else { byte [ ] b = new byte [ rem ] ; buffer . get ( b ) ; adler = updateBytes ( adler , b , 0 , b . length ) ; } buffer . position ( limit ) ; } | Updates the checksum with the bytes from the specified buffer . |
28,152 | int encodeCEs ( long ces [ ] , int cesLength ) { if ( cesLength < 0 || cesLength > Collation . MAX_EXPANSION_LENGTH ) { throw new IllegalArgumentException ( "mapping to too many CEs" ) ; } if ( ! isMutable ( ) ) { throw new IllegalStateException ( "attempt to add mappings after build()" ) ; } if ( cesLength == 0 ) { return encodeOneCEAsCE32 ( 0 ) ; } else if ( cesLength == 1 ) { return encodeOneCE ( ces [ 0 ] ) ; } else if ( cesLength == 2 ) { long ce0 = ces [ 0 ] ; long ce1 = ces [ 1 ] ; long p0 = ce0 >>> 32 ; if ( ( ce0 & 0xffffffffff00ffL ) == Collation . COMMON_SECONDARY_CE && ( ce1 & 0xffffffff00ffffffL ) == Collation . COMMON_TERTIARY_CE && p0 != 0 ) { return ( int ) p0 | ( ( ( int ) ce0 & 0xff00 ) << 8 ) | ( ( ( int ) ce1 >> 16 ) & 0xff00 ) | Collation . SPECIAL_CE32_LOW_BYTE | Collation . LATIN_EXPANSION_TAG ; } } int [ ] newCE32s = new int [ Collation . MAX_EXPANSION_LENGTH ] ; for ( int i = 0 ; ; ++ i ) { if ( i == cesLength ) { return encodeExpansion32 ( newCE32s , 0 , cesLength ) ; } int ce32 = encodeOneCEAsCE32 ( ces [ i ] ) ; if ( ce32 == Collation . NO_CE32 ) { break ; } newCE32s [ i ] = ce32 ; } return encodeExpansion ( ces , 0 , cesLength ) ; } | Encodes the ces as either the returned ce32 by itself or by storing an expansion with the returned ce32 referring to that . |
28,153 | void copyFrom ( CollationDataBuilder src , CEModifier modifier ) { if ( ! isMutable ( ) ) { throw new IllegalStateException ( "attempt to copyFrom() after build()" ) ; } CopyHelper helper = new CopyHelper ( src , this , modifier ) ; Iterator < Trie2 . Range > trieIterator = src . trie . iterator ( ) ; Trie2 . Range range ; while ( trieIterator . hasNext ( ) && ! ( range = trieIterator . next ( ) ) . leadSurrogate ) { enumRangeForCopy ( range . startCodePoint , range . endCodePoint , range . value , helper ) ; } modified |= src . modified ; } | Copies all mappings from the src builder with modifications . This builder here must not be built yet and should be empty . |
28,154 | protected int copyContractionsFromBaseCE32 ( StringBuilder context , int c , int ce32 , ConditionalCE32 cond ) { int trieIndex = Collation . indexFromCE32 ( ce32 ) ; int index ; if ( ( ce32 & Collation . CONTRACT_SINGLE_CP_NO_MATCH ) != 0 ) { assert ( context . length ( ) > 1 ) ; index = - 1 ; } else { ce32 = base . getCE32FromContexts ( trieIndex ) ; assert ( ! Collation . isContractionCE32 ( ce32 ) ) ; ce32 = copyFromBaseCE32 ( c , ce32 , true ) ; cond . next = index = addConditionalCE32 ( context . toString ( ) , ce32 ) ; cond = getConditionalCE32 ( index ) ; } int suffixStart = context . length ( ) ; CharsTrie . Iterator suffixes = CharsTrie . iterator ( base . contexts , trieIndex + 2 , 0 ) ; while ( suffixes . hasNext ( ) ) { CharsTrie . Entry entry = suffixes . next ( ) ; context . append ( entry . chars ) ; ce32 = copyFromBaseCE32 ( c , entry . value , true ) ; cond . next = index = addConditionalCE32 ( context . toString ( ) , ce32 ) ; cond = getConditionalCE32 ( index ) ; context . setLength ( suffixStart ) ; } assert ( index >= 0 ) ; return index ; } | Copies base contractions to a list of ConditionalCE32 . Sets cond . next to the index of the first new item and returns the index of the last new item . |
28,155 | private void socketWrite ( byte b [ ] , int off , int len ) throws IOException { if ( len <= 0 || off < 0 || off + len > b . length ) { if ( len == 0 ) { return ; } throw new ArrayIndexOutOfBoundsException ( ) ; } Object traceContext = IoTrace . socketWriteBegin ( ) ; int bytesWritten = 0 ; FileDescriptor fd = impl . acquireFD ( ) ; try { BlockGuard . getThreadPolicy ( ) . onNetwork ( ) ; socketWrite0 ( fd , b , off , len ) ; bytesWritten = len ; } catch ( SocketException se ) { if ( se instanceof sun . net . ConnectionResetException ) { impl . setConnectionResetPending ( ) ; se = new SocketException ( "Connection reset" ) ; } if ( impl . isClosedOrPending ( ) ) { throw new SocketException ( "Socket closed" ) ; } else { throw se ; } } finally { IoTrace . socketWriteEnd ( traceContext , impl . address , impl . port , bytesWritten ) ; } } | Writes to the socket with appropriate locking of the FileDescriptor . |
28,156 | private static int initializeTimeout ( ) { Integer tmp = Integer . getInteger ( "com.sun.security.crl.timeout" ) ; if ( tmp == null || tmp < 0 ) { return DEFAULT_CRL_CONNECT_TIMEOUT ; } return tmp * 1000 ; } | Initialize the timeout length by getting the CRL timeout system property . If the property has not been set or if its value is negative set the timeout length to the default . |
28,157 | static CertStore getInstance ( AccessDescription ad ) { if ( ! ad . getAccessMethod ( ) . equals ( ( Object ) AccessDescription . Ad_CAISSUERS_Id ) ) { return null ; } GeneralNameInterface gn = ad . getAccessLocation ( ) . getName ( ) ; if ( ! ( gn instanceof URIName ) ) { return null ; } URI uri = ( ( URIName ) gn ) . getURI ( ) ; try { return URICertStore . getInstance ( new URICertStore . URICertStoreParameters ( uri ) ) ; } catch ( Exception ex ) { if ( debug != null ) { debug . println ( "exception creating CertStore: " + ex ) ; ex . printStackTrace ( ) ; } return null ; } } | Creates a CertStore from information included in the AccessDescription object of a certificate s Authority Information Access Extension . |
28,158 | private static Collection < X509Certificate > getMatchingCerts ( Collection < X509Certificate > certs , CertSelector selector ) { if ( selector == null ) { return certs ; } List < X509Certificate > matchedCerts = new ArrayList < > ( certs . size ( ) ) ; for ( X509Certificate cert : certs ) { if ( selector . match ( cert ) ) { matchedCerts . add ( cert ) ; } } return matchedCerts ; } | Iterates over the specified Collection of X509Certificates and returns only those that match the criteria specified in the CertSelector . |
28,159 | private static Collection < X509CRL > getMatchingCRLs ( X509CRL crl , CRLSelector selector ) { if ( selector == null || ( crl != null && selector . match ( crl ) ) ) { return Collections . singletonList ( crl ) ; } else { return Collections . emptyList ( ) ; } } | Checks if the specified X509CRL matches the criteria specified in the CRLSelector . |
28,160 | public static int getSingleCodePoint ( CharSequence s ) { int length = s . length ( ) ; if ( length < 1 || length > 2 ) { return Integer . MAX_VALUE ; } int result = Character . codePointAt ( s , 0 ) ; return ( result < 0x10000 ) == ( length == 1 ) ? result : Integer . MAX_VALUE ; } | Return the value of the first code point if the string is exactly one code point . Otherwise return Integer . MAX_VALUE . |
28,161 | public static boolean onCharacterBoundary ( CharSequence s , int i ) { return i <= 0 || i >= s . length ( ) || ! Character . isHighSurrogate ( s . charAt ( i - 1 ) ) || ! Character . isLowSurrogate ( s . charAt ( i ) ) ; } | Are we on a character boundary? |
28,162 | public static int indexOf ( CharSequence s , int codePoint ) { int cp ; for ( int i = 0 ; i < s . length ( ) ; i += Character . charCount ( cp ) ) { cp = Character . codePointAt ( s , i ) ; if ( cp == codePoint ) { return i ; } } return - 1 ; } | Find code point in string . |
28,163 | NativeObject getObject ( int offset ) { long newAddress = 0L ; switch ( addressSize ( ) ) { case 8 : newAddress = unsafe . getLong ( offset + address ) ; break ; case 4 : newAddress = unsafe . getInt ( offset + address ) & 0x00000000FFFFFFFF ; break ; default : throw new InternalError ( "Address size not supported" ) ; } return new NativeObject ( newAddress ) ; } | Reads an address from this native object at the given offset and constructs a native object using that address . |
28,164 | void putObject ( int offset , NativeObject ob ) { switch ( addressSize ( ) ) { case 8 : putLong ( offset , ob . address ) ; break ; case 4 : putInt ( offset , ( int ) ( ob . address & 0x00000000FFFFFFFF ) ) ; break ; default : throw new InternalError ( "Address size not supported" ) ; } } | Writes the base address of the given native object at the given offset of this native object . |
28,165 | static ByteOrder byteOrder ( ) { if ( byteOrder != null ) return byteOrder ; long a = unsafe . allocateMemory ( 8 ) ; try { unsafe . putLong ( a , 0x0102030405060708L ) ; byte b = unsafe . getByte ( a ) ; switch ( b ) { case 0x01 : byteOrder = ByteOrder . BIG_ENDIAN ; break ; case 0x08 : byteOrder = ByteOrder . LITTLE_ENDIAN ; break ; default : assert false ; } } finally { unsafe . freeMemory ( a ) ; } return byteOrder ; } | Returns the byte order of the underlying hardware . |
28,166 | private static String join ( String prefix , String suffix ) { int prefixLength = prefix . length ( ) ; boolean haveSlash = ( prefixLength > 0 && prefix . charAt ( prefixLength - 1 ) == separatorChar ) ; if ( ! haveSlash ) { haveSlash = ( suffix . length ( ) > 0 && suffix . charAt ( 0 ) == separatorChar ) ; } return haveSlash ? ( prefix + suffix ) : ( prefix + separatorChar + suffix ) ; } | Joins two path components adding a separator only if necessary . |
28,167 | public boolean setExecutable ( boolean executable , boolean ownerOnly ) { return doChmod ( ownerOnly ? S_IXUSR : ( S_IXUSR | S_IXGRP | S_IXOTH ) , executable ) ; } | Manipulates the execute permissions for the abstract path designated by this file . |
28,168 | public boolean setReadable ( boolean readable , boolean ownerOnly ) { return doChmod ( ownerOnly ? S_IRUSR : ( S_IRUSR | S_IRGRP | S_IROTH ) , readable ) ; } | Manipulates the read permissions for the abstract path designated by this file . |
28,169 | public boolean setWritable ( boolean writable , boolean ownerOnly ) { return doChmod ( ownerOnly ? S_IWUSR : ( S_IWUSR | S_IWGRP | S_IWOTH ) , writable ) ; } | Manipulates the write permissions for the abstract path designated by this file . |
28,170 | public long getTotalSpace ( ) { try { StructStatVfs sb = Libcore . os . statvfs ( path ) ; return sb . f_blocks * sb . f_bsize ; } catch ( ErrnoException errnoException ) { return 0 ; } } | Returns the total size in bytes of the partition containing this path . Returns 0 if this path does not exist . |
28,171 | public long getUsableSpace ( ) { try { StructStatVfs sb = Libcore . os . statvfs ( path ) ; return sb . f_bavail * sb . f_bsize ; } catch ( ErrnoException errnoException ) { return 0 ; } } | Returns the number of usable free bytes on the partition containing this path . Returns 0 if this path does not exist . |
28,172 | public long getFreeSpace ( ) { try { StructStatVfs sb = Libcore . os . statvfs ( path ) ; return sb . f_bfree * sb . f_bsize ; } catch ( ErrnoException errnoException ) { return 0 ; } } | Returns the number of free bytes on the partition containing this path . Returns 0 if this path does not exist . |
28,173 | private void allocateElements ( int numElements ) { int initialCapacity = MIN_INITIAL_CAPACITY ; if ( numElements >= initialCapacity ) { initialCapacity = numElements ; initialCapacity |= ( initialCapacity >>> 1 ) ; initialCapacity |= ( initialCapacity >>> 2 ) ; initialCapacity |= ( initialCapacity >>> 4 ) ; initialCapacity |= ( initialCapacity >>> 8 ) ; initialCapacity |= ( initialCapacity >>> 16 ) ; initialCapacity ++ ; if ( initialCapacity < 0 ) initialCapacity >>>= 1 ; } elements = new Object [ initialCapacity ] ; } | Allocates empty array to hold the given number of elements . |
28,174 | private void doubleCapacity ( ) { assert head == tail ; int p = head ; int n = elements . length ; int r = n - p ; int newCapacity = n << 1 ; if ( newCapacity < 0 ) throw new IllegalStateException ( "Sorry, deque too big" ) ; Object [ ] a = new Object [ newCapacity ] ; System . arraycopy ( elements , p , a , 0 , r ) ; System . arraycopy ( elements , 0 , a , r , p ) ; elements = a ; head = 0 ; tail = n ; } | Doubles the capacity of this deque . Call only when full i . e . when head and tail have wrapped around to become equal . |
28,175 | public void addFirst ( E e ) { if ( e == null ) throw new NullPointerException ( ) ; elements [ head = ( head - 1 ) & ( elements . length - 1 ) ] = e ; if ( head == tail ) doubleCapacity ( ) ; } | Inserts the specified element at the front of this deque . |
28,176 | public void addLast ( E e ) { if ( e == null ) throw new NullPointerException ( ) ; elements [ tail ] = e ; if ( ( tail = ( tail + 1 ) & ( elements . length - 1 ) ) == head ) doubleCapacity ( ) ; } | Inserts the specified element at the end of this deque . |
28,177 | public void clear ( ) { int h = head ; int t = tail ; if ( h != t ) { head = tail = 0 ; int i = h ; int mask = elements . length - 1 ; do { elements [ i ] = null ; i = ( i + 1 ) & mask ; } while ( i != t ) ; } } | Removes all of the elements from this deque . The deque will be empty after this call returns . |
28,178 | public boolean isInZeroBlock ( int ch ) { if ( m_isCompacted_ || ch > UCharacter . MAX_VALUE || ch < UCharacter . MIN_VALUE ) { return true ; } return m_index_ [ ch >> SHIFT_ ] == 0 ; } | Checks if the character belongs to a zero block in the trie |
28,179 | protected static final boolean equal_int ( int [ ] array , int start1 , int start2 , int length ) { while ( length > 0 && array [ start1 ] == array [ start2 ] ) { ++ start1 ; ++ start2 ; -- length ; } return length == 0 ; } | Compare two sections of an array for equality . |
28,180 | protected static final int findSameIndexBlock ( int index [ ] , int indexLength , int otherBlock ) { for ( int block = BMP_INDEX_LENGTH_ ; block < indexLength ; block += SURROGATE_BLOCK_COUNT_ ) { if ( equal_int ( index , block , otherBlock , SURROGATE_BLOCK_COUNT_ ) ) { return block ; } } return indexLength ; } | Finds the same index block as the otherBlock |
28,181 | protected void fireEndElem ( String name ) throws org . xml . sax . SAXException { if ( m_tracer != null ) { flushMyWriter ( ) ; m_tracer . fireGenerateEvent ( SerializerTrace . EVENTTYPE_ENDELEMENT , name , ( Attributes ) null ) ; } } | To fire off the end element trace event |
28,182 | protected void fireCharEvent ( char [ ] chars , int start , int length ) throws org . xml . sax . SAXException { if ( m_tracer != null ) { flushMyWriter ( ) ; m_tracer . fireGenerateEvent ( SerializerTrace . EVENTTYPE_CHARACTERS , chars , start , length ) ; } } | Report the characters trace event |
28,183 | public void addAttribute ( String name , final String value ) { if ( m_elemContext . m_startTagOpen ) { final String patchedName = patchName ( name ) ; final String localName = getLocalName ( patchedName ) ; final String uri = getNamespaceURI ( patchedName , false ) ; addAttributeAlways ( uri , localName , patchedName , "CDATA" , value , false ) ; } } | Adds the given attribute to the set of collected attributes but only if there is a currently open element . |
28,184 | public void addAttributes ( Attributes atts ) throws SAXException { int nAtts = atts . getLength ( ) ; for ( int i = 0 ; i < nAtts ; i ++ ) { String uri = atts . getURI ( i ) ; if ( null == uri ) uri = "" ; addAttributeAlways ( uri , atts . getLocalName ( i ) , atts . getQName ( i ) , atts . getType ( i ) , atts . getValue ( i ) , false ) ; } } | Add the given attributes to the currently collected ones . These attributes are always added regardless of whether on not an element is currently open . |
28,185 | public void endEntity ( String name ) throws org . xml . sax . SAXException { if ( name . equals ( "[dtd]" ) ) m_inExternalDTD = false ; m_inEntityRef = false ; if ( m_tracer != null ) this . fireEndEntity ( name ) ; } | Report the end of an entity . |
28,186 | private static final boolean subPartMatch ( String p , String t ) { return ( p == t ) || ( ( null != p ) && ( p . equals ( t ) ) ) ; } | Tell if two strings are equal without worry if the first string is null . |
28,187 | public String getNamespaceURI ( String qname , boolean isElement ) { String uri = EMPTYSTRING ; int col = qname . lastIndexOf ( ':' ) ; final String prefix = ( col > 0 ) ? qname . substring ( 0 , col ) : EMPTYSTRING ; if ( ! EMPTYSTRING . equals ( prefix ) || isElement ) { if ( m_prefixMap != null ) { uri = m_prefixMap . lookupNamespace ( prefix ) ; if ( uri == null && ! prefix . equals ( XMLNS_PREFIX ) ) { throw new RuntimeException ( Utils . messages . createMessage ( MsgKey . ER_NAMESPACE_PREFIX , new Object [ ] { qname . substring ( 0 , col ) } ) ) ; } } } return uri ; } | Returns the URI of an element or attribute . Note that default namespaces do not apply directly to attributes . |
28,188 | public void entityReference ( String name ) throws org . xml . sax . SAXException { flushPending ( ) ; startEntity ( name ) ; endEntity ( name ) ; if ( m_tracer != null ) fireEntityReference ( name ) ; } | Entity reference event . |
28,189 | public void setTransformer ( Transformer t ) { m_transformer = t ; if ( ( m_transformer instanceof SerializerTrace ) && ( ( ( SerializerTrace ) m_transformer ) . hasTraceListeners ( ) ) ) { m_tracer = ( SerializerTrace ) m_transformer ; } else { m_tracer = null ; } } | Sets the transformer associated with this serializer |
28,190 | public void characters ( org . w3c . dom . Node node ) throws org . xml . sax . SAXException { flushPending ( ) ; String data = node . getNodeValue ( ) ; if ( data != null ) { final int length = data . length ( ) ; if ( length > m_charsBuff . length ) { m_charsBuff = new char [ length * 2 + 1 ] ; } data . getChars ( 0 , length , m_charsBuff , 0 ) ; characters ( m_charsBuff , 0 , length ) ; } } | This method gets the nodes value as a String and uses that String as if it were an input character notification . |
28,191 | protected void fireStartEntity ( String name ) throws org . xml . sax . SAXException { if ( m_tracer != null ) { flushMyWriter ( ) ; m_tracer . fireGenerateEvent ( SerializerTrace . EVENTTYPE_ENTITYREF , name ) ; } } | To fire off start entity trace event |
28,192 | protected void fireCDATAEvent ( char [ ] chars , int start , int length ) throws org . xml . sax . SAXException { if ( m_tracer != null ) { flushMyWriter ( ) ; m_tracer . fireGenerateEvent ( SerializerTrace . EVENTTYPE_CDATA , chars , start , length ) ; } } | Report the CDATA trace event |
28,193 | protected void fireCommentEvent ( char [ ] chars , int start , int length ) throws org . xml . sax . SAXException { if ( m_tracer != null ) { flushMyWriter ( ) ; m_tracer . fireGenerateEvent ( SerializerTrace . EVENTTYPE_COMMENT , new String ( chars , start , length ) ) ; } } | Report the comment trace event |
28,194 | public void fireEndEntity ( String name ) throws org . xml . sax . SAXException { if ( m_tracer != null ) flushMyWriter ( ) ; } | To fire off end entity trace event |
28,195 | protected void fireStartDoc ( ) throws org . xml . sax . SAXException { if ( m_tracer != null ) { flushMyWriter ( ) ; m_tracer . fireGenerateEvent ( SerializerTrace . EVENTTYPE_STARTDOCUMENT ) ; } } | To fire off start document trace event |
28,196 | protected void fireEndDoc ( ) throws org . xml . sax . SAXException { if ( m_tracer != null ) { flushMyWriter ( ) ; m_tracer . fireGenerateEvent ( SerializerTrace . EVENTTYPE_ENDDOCUMENT ) ; } } | To fire off end document trace event |
28,197 | protected void fireStartElem ( String elemName ) throws org . xml . sax . SAXException { if ( m_tracer != null ) { flushMyWriter ( ) ; m_tracer . fireGenerateEvent ( SerializerTrace . EVENTTYPE_STARTELEMENT , elemName , m_attributes ) ; } } | Report the start element trace event . This trace method needs to be called just before the attributes are cleared . |
28,198 | protected void fireEscapingEvent ( String name , String data ) throws org . xml . sax . SAXException { if ( m_tracer != null ) { flushMyWriter ( ) ; m_tracer . fireGenerateEvent ( SerializerTrace . EVENTTYPE_PI , name , data ) ; } } | To fire off the PI trace event |
28,199 | private void resetSerializerBase ( ) { this . m_attributes . clear ( ) ; this . m_CdataElems = null ; this . m_cdataTagOpen = false ; this . m_docIsEmpty = true ; this . m_doctypePublic = null ; this . m_doctypeSystem = null ; this . m_doIndent = false ; this . m_elemContext = new ElemContext ( ) ; this . m_indentAmount = 0 ; this . m_inEntityRef = false ; this . m_inExternalDTD = false ; this . m_mediatype = null ; this . m_needToCallStartDocument = true ; this . m_needToOutputDocTypeDecl = false ; if ( m_OutputProps != null ) this . m_OutputProps . clear ( ) ; if ( m_OutputPropsDefault != null ) this . m_OutputPropsDefault . clear ( ) ; if ( this . m_prefixMap != null ) this . m_prefixMap . reset ( ) ; this . m_shouldNotWriteXMLHeader = false ; this . m_sourceLocator = null ; this . m_standalone = null ; this . m_standaloneWasSpecified = false ; this . m_StringOfCDATASections = null ; this . m_tracer = null ; this . m_transformer = null ; this . m_version = null ; } | Reset all of the fields owned by SerializerBase |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.