idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
126,400
private static PatternConverter createConverter ( final String converterId , final StringBuffer currentLiteral , final Map converterRegistry , final Map rules , final List options ) { String converterName = converterId ; Object converterObj = null ; for ( int i = converterId . length ( ) ; ( i > 0 ) && ( converterObj =...
Creates a new PatternConverter .
126,401
private static int finalizeConverter ( char c , String pattern , int i , final StringBuffer currentLiteral , final ExtrasFormattingInfo formattingInfo , final Map converterRegistry , final Map rules , final List patternConverters , final List formattingInfos ) { StringBuffer convBuf = new StringBuffer ( ) ; i = extract...
Processes a format specifier sequence .
126,402
public StructuredDataId makeId ( final StructuredDataId id ) { if ( id == null ) { return this ; } return makeId ( id . getName ( ) , id . getEnterpriseNumber ( ) ) ; }
Creates an id using another id to supply default values .
126,403
public StructuredDataId makeId ( final String defaultId , final int anEnterpriseNumber ) { String id ; String [ ] req ; String [ ] opt ; if ( anEnterpriseNumber <= 0 ) { return this ; } if ( this . name != null ) { id = this . name ; req = this . required ; opt = this . optional ; } else { id = defaultId ; req = null ;...
Creates an id based on the current id .
126,404
public String [ ] getFormats ( ) { final String [ ] formats = new String [ Format . values ( ) . length ] ; int i = 0 ; for ( final Format format : Format . values ( ) ) { formats [ i ++ ] = format . name ( ) ; } return formats ; }
Returns the supported formats .
126,405
public String getFormattedMessage ( ) { if ( formattedMessage != null ) { return formattedMessage ; } final StringBuilder sb = new StringBuilder ( 255 ) ; formatTo ( sb ) ; return sb . toString ( ) ; }
Returns the ThreadDump in printable format .
126,406
public Object [ ] swapParameters ( final Object [ ] emptyReplacement ) { Object [ ] result ; if ( varargs == null ) { result = params ; if ( emptyReplacement . length >= MAX_PARMS ) { params = emptyReplacement ; } else { if ( argCount <= emptyReplacement . length ) { System . arraycopy ( params , 0 , emptyReplacement ,...
see interface javadoc
126,407
void rollOver ( ) throws IOException { if ( getCompressBackups ( ) . equalsIgnoreCase ( "YES" ) || getCompressBackups ( ) . equalsIgnoreCase ( "TRUE" ) ) { File file = new File ( fileName ) ; Thread fileCompressor = new Thread ( new CompressFile ( file ) ) ; fileCompressor . start ( ) ; } if ( datePattern == null ) { e...
Rollover the current file to a new file .
126,408
protected void subAppend ( LoggingEvent event ) { long n = event . timeStamp ; if ( n >= nextCheck ) { try { now . setTime ( n ) ; cleanupAndRollOver ( ) ; } catch ( IOException ioe ) { if ( ioe instanceof InterruptedIOException ) { Thread . currentThread ( ) . interrupt ( ) ; } LogLog . error ( "rollOver() failed." , ...
This method differentiates DailyRollingFileAppender from its super class .
126,409
public void printThreadInfo ( final StringBuilder sb ) { StringBuilders . appendDqValue ( sb , name ) . append ( Chars . SPACE ) ; if ( isDaemon ) { sb . append ( "daemon " ) ; } sb . append ( "prio=" ) . append ( priority ) . append ( " tid=" ) . append ( id ) . append ( ' ' ) ; if ( threadGroupName != null ) { String...
Print the thread information .
126,410
public void printStack ( final StringBuilder sb , final StackTraceElement [ ] trace ) { for ( final StackTraceElement element : trace ) { sb . append ( "\tat " ) . append ( element ) . append ( '\n' ) ; } }
Format the StackTraceElements .
126,411
void getProperties ( Connection connection , long id , LoggingEvent event ) throws SQLException { PreparedStatement statement = connection . prepareStatement ( sqlProperties ) ; try { statement . setLong ( 1 , id ) ; ResultSet rs = statement . executeQuery ( ) ; while ( rs . next ( ) ) { String key = rs . getString ( 1...
Retrieve the event properties from the logging_event_property table .
126,412
ThrowableInformation getException ( Connection connection , long id ) throws SQLException { PreparedStatement statement = null ; try { statement = connection . prepareStatement ( sqlException ) ; statement . setLong ( 1 , id ) ; ResultSet rs = statement . executeQuery ( ) ; Vector v = new Vector ( ) ; while ( rs . next...
Retrieve the exception string representation from the logging_event_exception table .
126,413
public static Priority [ ] getAllPossiblePriorities ( ) { return new Priority [ ] { Priority . FATAL , Priority . ERROR , Level . WARN , Priority . INFO , Priority . DEBUG , Level . TRACE } ; }
Return all possible priorities as an array of Level objects in descending order .
126,414
public static void shutdown ( final LoggerContext context ) { if ( context != null && context instanceof Terminable ) { ( ( Terminable ) context ) . terminate ( ) ; } }
Shutdown the logging system if the logging system supports it .
126,415
public static Logger getLogger ( final Class < ? > clazz ) { final Class < ? > cls = callerClass ( clazz ) ; return getContext ( cls . getClassLoader ( ) , false ) . getLogger ( cls . getCanonicalName ( ) ) ; }
Returns a Logger using the fully qualified name of the Class as the Logger name .
126,416
public static Logger getLogger ( final Object value ) { return getLogger ( value != null ? value . getClass ( ) : StackLocatorUtil . getCallerClass ( 2 ) ) ; }
Returns a Logger using the fully qualified class name of the value as the Logger name .
126,417
public void setProperty ( String name , String value ) { if ( value == null ) return ; name = Introspector . decapitalize ( name ) ; PropertyDescriptor prop = getPropertyDescriptor ( name ) ; if ( prop == null ) { LogLog . warn ( "No such property [" + name + "] in " + obj . getClass ( ) . getName ( ) + "." ) ; } else ...
Set a property on this PaxPropertySetter s Object . If successful this method will invoke a setter method on the underlying Object . The setter is the one for the specified property name and the value is determined partly from the setter argument type and partly from the value specified in the call to this method .
126,418
static Properties loadClose ( final InputStream in , final Object source ) { final Properties props = new Properties ( ) ; if ( null != in ) { try { props . load ( in ) ; } catch ( final IOException e ) { LowLevelLogUtil . logException ( "Unable to read " + source , e ) ; } finally { try { in . close ( ) ; } catch ( fi...
Loads and closes the given property input stream . If an error occurs log to the status logger .
126,419
public Charset getCharsetProperty ( final String name , final Charset defaultValue ) { final String prop = getStringProperty ( name ) ; try { return prop == null ? defaultValue : Charset . forName ( prop ) ; } catch ( UnsupportedCharsetException e ) { LowLevelLogUtil . logException ( "Unable to get Charset '" + name + ...
Gets the named property as a Charset value .
126,420
public double getDoubleProperty ( final String name , final double defaultValue ) { final String prop = getStringProperty ( name ) ; if ( prop != null ) { try { return Double . parseDouble ( prop ) ; } catch ( final Exception ignored ) { return defaultValue ; } } return defaultValue ; }
Gets the named property as a double .
126,421
public int getIntegerProperty ( final String name , final int defaultValue ) { final String prop = getStringProperty ( name ) ; if ( prop != null ) { try { return Integer . parseInt ( prop ) ; } catch ( final Exception ignored ) { return defaultValue ; } } return defaultValue ; }
Gets the named property as an integer .
126,422
public long getLongProperty ( final String name , final long defaultValue ) { final String prop = getStringProperty ( name ) ; if ( prop != null ) { try { return Long . parseLong ( prop ) ; } catch ( final Exception ignored ) { return defaultValue ; } } return defaultValue ; }
Gets the named property as a long .
126,423
public String getStringProperty ( final String name ) { String prop = null ; try { prop = System . getProperty ( name ) ; } catch ( final SecurityException ignored ) { } return prop == null ? props . getProperty ( name ) : prop ; }
Gets the named property as a String .
126,424
public static Properties getSystemProperties ( ) { try { return new Properties ( System . getProperties ( ) ) ; } catch ( final SecurityException ex ) { LowLevelLogUtil . logException ( "Unable to access system properties." , ex ) ; return new Properties ( ) ; } }
Return the system properties or an empty Properties object if an error occurs .
126,425
public static Properties extractSubset ( final Properties properties , final String prefix ) { final Properties subset = new Properties ( ) ; if ( prefix == null || prefix . length ( ) == 0 ) { return subset ; } final String prefixToMatch = prefix . charAt ( prefix . length ( ) - 1 ) != '.' ? prefix + '.' : prefix ; fi...
Extracts properties that start with or are equals to the specific prefix and returns them in a new Properties object with the prefix removed .
126,426
public static Map < String , Properties > partitionOnCommonPrefixes ( final Properties properties ) { final Map < String , Properties > parts = new ConcurrentHashMap < > ( ) ; for ( final String key : properties . stringPropertyNames ( ) ) { final String prefix = key . substring ( 0 , key . indexOf ( '.' ) ) ; if ( ! p...
Partitions a properties map based on common key prefixes up to the first period .
126,427
public String applyFields ( final String replaceText , final LoggingEvent event ) { if ( replaceText == null ) { return null ; } InFixToPostFix . CustomTokenizer tokenizer = new InFixToPostFix . CustomTokenizer ( replaceText ) ; StringBuffer result = new StringBuffer ( ) ; boolean found = false ; while ( tokenizer . ha...
Apply fields .
126,428
public boolean isField ( final String fieldName ) { if ( fieldName != null ) { return ( KEYWORD_LIST . contains ( fieldName . toUpperCase ( Locale . US ) ) || fieldName . toUpperCase ( ) . startsWith ( PROP_FIELD ) ) ; } return false ; }
Determines if specified string is a recognized field .
126,429
public Object getValue ( final String fieldName , final LoggingEvent event ) { String upperField = fieldName . toUpperCase ( Locale . US ) ; if ( LOGGER_FIELD . equals ( upperField ) ) { return event . getLoggerName ( ) ; } else if ( LEVEL_FIELD . equals ( upperField ) ) { return event . getLevel ( ) ; } else if ( MSG_...
Get value of field .
126,430
private static String getExceptionMessage ( final String [ ] exception ) { StringBuffer buff = new StringBuffer ( ) ; for ( int i = 0 ; i < exception . length ; i ++ ) { buff . append ( exception [ i ] ) ; } return buff . toString ( ) ; }
Get message from throwable representation .
126,431
public void trace ( String format , Object arg ) { if ( m_delegate . isTraceEnabled ( ) ) { FormattingTuple tuple = MessageFormatter . format ( format , arg ) ; m_delegate . trace ( tuple . getMessage ( ) , tuple . getThrowable ( ) ) ; } }
Log a message at the TRACE level according to the specified format and argument .
126,432
public void trace ( Marker marker , String msg ) { if ( m_delegate . isTraceEnabled ( ) ) { setMDCMarker ( marker ) ; m_delegate . trace ( msg , null ) ; resetMDCMarker ( ) ; } }
Log a message with the specific Marker at the TRACE level .
126,433
public void debug ( String format , Object arg ) { if ( m_delegate . isDebugEnabled ( ) ) { FormattingTuple tuple = MessageFormatter . format ( format , arg ) ; m_delegate . debug ( tuple . getMessage ( ) , tuple . getThrowable ( ) ) ; } }
Log a message at the DEBUG level according to the specified format and argument .
126,434
public void debug ( Marker marker , String msg ) { if ( m_delegate . isDebugEnabled ( ) ) { setMDCMarker ( marker ) ; m_delegate . debug ( msg , null ) ; resetMDCMarker ( ) ; } }
Log a message with the specific Marker at the DEBUG level .
126,435
public void info ( String format , Object arg1 , Object arg2 ) { if ( m_delegate . isInfoEnabled ( ) ) { FormattingTuple tuple = MessageFormatter . format ( format , arg1 , arg2 ) ; m_delegate . inform ( tuple . getMessage ( ) , tuple . getThrowable ( ) ) ; } }
Log a message at the INFO level according to the specified format and arguments .
126,436
public void info ( Marker marker , String msg ) { if ( m_delegate . isInfoEnabled ( ) ) { setMDCMarker ( marker ) ; m_delegate . inform ( msg , null ) ; resetMDCMarker ( ) ; } }
Log a message with the specific Marker at the INFO level .
126,437
public void warn ( Marker marker , String msg ) { if ( m_delegate . isWarnEnabled ( ) ) { setMDCMarker ( marker ) ; m_delegate . warn ( msg , null ) ; resetMDCMarker ( ) ; } }
Log a message with the specific Marker at the WARN level .
126,438
public void error ( String format , Object arg ) { if ( m_delegate . isErrorEnabled ( ) ) { FormattingTuple tuple = MessageFormatter . format ( format , arg ) ; m_delegate . error ( tuple . getMessage ( ) , tuple . getThrowable ( ) ) ; } }
Log a message at the ERROR level according to the specified format and argument .
126,439
public void error ( Marker marker , String msg ) { if ( m_delegate . isErrorEnabled ( ) ) { setMDCMarker ( marker ) ; m_delegate . error ( msg , null ) ; resetMDCMarker ( ) ; } }
Log a message with the specific Marker at the ERROR level .
126,440
public void log ( Marker marker , String fqcn , int level , String message , Object [ ] argArray , Throwable t ) { setMDCMarker ( marker ) ; switch ( level ) { case ( TRACE_INT ) : if ( m_delegate . isTraceEnabled ( ) ) { FormattingTuple tuple = MessageFormatter . arrayFormat ( message , argArray ) ; m_delegate . trace...
This method implements LocationAwareLogger . log
126,441
public static Rule getRule ( final Stack stack ) { if ( stack . size ( ) < 1 ) { throw new IllegalArgumentException ( "Invalid NOT rule - expected one rule but received " + stack . size ( ) ) ; } Object o1 = stack . pop ( ) ; if ( o1 instanceof Rule ) { Rule p1 = ( Rule ) o1 ; return new NotRule ( p1 ) ; } throw new Il...
Create new instance from top element of stack .
126,442
public void fatal ( final Object message ) { if ( m_delegate . isFatalEnabled ( ) && message != null ) { m_delegate . fatal ( message . toString ( ) , null ) ; } }
Log a message object with the FATAL Level .
126,443
public String getFormattedMessage ( ) { if ( formattedMessage != null ) { return formattedMessage ; } ResourceBundle bundle = this . resourceBundle ; if ( bundle == null ) { if ( baseName != null ) { bundle = getResourceBundle ( baseName , locale , false ) ; } else { bundle = getResourceBundle ( loggerName , locale , t...
Returns the formatted message after looking up the format in the resource bundle .
126,444
protected ResourceBundle getResourceBundle ( final String rbBaseName , final Locale resourceBundleLocale , final boolean loop ) { ResourceBundle rb = null ; if ( rbBaseName == null ) { return null ; } try { if ( resourceBundleLocale != null ) { rb = ResourceBundle . getBundle ( rbBaseName , resourceBundleLocale ) ; } e...
Override this to use a ResourceBundle . Control in Java 6
126,445
public static Marker getMarker ( final String name ) { Marker result = MARKERS . get ( name ) ; if ( result == null ) { MARKERS . putIfAbsent ( name , new Log4jMarker ( name ) ) ; result = MARKERS . get ( name ) ; } return result ; }
Retrieves a Marker or create a Marker that has no parent .
126,446
public static Marker getMarker ( final String name , final String parent ) { final Marker parentMarker = MARKERS . get ( parent ) ; if ( parentMarker == null ) { throw new IllegalArgumentException ( "Parent Marker " + parent + " has not been defined" ) ; } return getMarker ( name , parentMarker ) ; }
Retrieves or creates a Marker with the specified parent . The parent must have been previously created .
126,447
public static Marker getMarker ( final String name , final Marker parent ) { return getMarker ( name ) . addParents ( parent ) ; }
Retrieves or creates a Marker with the specified parent .
126,448
public Class < ? > getCallerClass ( final int depth ) { if ( depth < 0 ) { throw new IndexOutOfBoundsException ( Integer . toString ( depth ) ) ; } try { return ( Class < ? > ) GET_CALLER_CLASS . invoke ( null , depth + 1 + JDK_7u25_OFFSET ) ; } catch ( final Exception e ) { return null ; } }
migrated from ReflectiveCallerClassUtility
126,449
public Class < ? > getCallerClass ( final Class < ? > anchor ) { boolean next = false ; Class < ? > clazz ; for ( int i = 2 ; null != ( clazz = getCallerClass ( i ) ) ; i ++ ) { if ( anchor . equals ( clazz ) ) { next = true ; continue ; } if ( next ) { return clazz ; } } return Object . class ; }
added for use in LoggerAdapter implementations mainly
126,450
public Stack < Class < ? > > getCurrentStackTrace ( ) { if ( getSecurityManager ( ) != null ) { final Class < ? > [ ] array = getSecurityManager ( ) . getClassContext ( ) ; final Stack < Class < ? > > classes = new Stack < > ( ) ; classes . ensureCapacity ( array . length ) ; for ( final Class < ? > clazz : array ) { c...
migrated from ThrowableProxy
126,451
public String getFormattedMessage ( ) { if ( formattedMessage == null ) { if ( message == null ) { message = getMessage ( messagePattern , argArray , throwable ) ; } formattedMessage = message . getFormattedMessage ( ) ; } return formattedMessage ; }
Gets the formatted message .
126,452
public void shutdown ( ) { try { if ( reader != null ) { reader . close ( ) ; reader = null ; } } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; } }
Close the receiver release any resources that are accessing the file .
126,453
public void activateOptions ( ) { Runnable runnable = new Runnable ( ) { public void run ( ) { try { URL url = new URL ( fileURL ) ; host = url . getHost ( ) ; if ( host != null && host . equals ( "" ) ) { host = FILE_KEY ; } path = url . getPath ( ) ; } catch ( MalformedURLException e1 ) { e1 . printStackTrace ( ) ; }...
Process the file
126,454
public void setName ( final String repoName ) { if ( name == null ) { name = repoName ; } else if ( ! name . equals ( repoName ) ) { throw new IllegalStateException ( "Repository [" + name + "] cannot be renamed as [" + repoName + "]." ) ; } }
Set the name of this repository .
126,455
public Scheduler getScheduler ( ) { if ( scheduler == null ) { scheduler = new Scheduler ( ) ; scheduler . setDaemon ( true ) ; scheduler . start ( ) ; } return scheduler ; }
Return this repository s own scheduler . The scheduler is lazily instantiated .
126,456
private void parameterizedLog ( final String level , final Object parameterizedMsg , final Object param1 , final Object param2 ) { if ( parameterizedMsg instanceof String ) { String msgStr = ( String ) parameterizedMsg ; msgStr = MessageFormatter . format ( msgStr , param1 , param2 ) ; log ( level , msgStr , null ) ; }...
For parameterized messages first substitute parameters and then log .
126,457
boolean archiveFile ( File logFile ) { FileOutputStream fOut ; ZipOutputStream zOut ; try { fOut = new FileOutputStream ( logFile . getPath ( ) + ".zip" ) ; zOut = new ZipOutputStream ( fOut ) ; FileInputStream fIn = new FileInputStream ( logFile ) ; BufferedInputStream bIn = new BufferedInputStream ( fIn ) ; ZipEntry ...
archive log file
126,458
public ClassLoader getClassLoader ( ) { return classloader != null ? classloader : ( classloader = Loader . getClassLoader ( ResolverUtil . class , null ) ) ; }
Returns the classloader that will be used for scanning for classes . If no explicit ClassLoader has been set by the calling the context class loader will be used .
126,459
protected void addIfMatching ( final Test test , final String fqn ) { try { final ClassLoader loader = getClassLoader ( ) ; if ( test . doesMatchClass ( ) ) { final String externalName = fqn . substring ( 0 , fqn . indexOf ( '.' ) ) . replace ( '/' , '.' ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Checki...
Add the class designated by the fully qualified class name provided to the set of resolved classes if and only if it is approved by the Test supplied .
126,460
public void activateOptions ( ) { if ( follow ) { if ( target . equals ( SYSTEM_ERR ) ) { setWriter ( createWriter ( new SystemErrStream ( ) ) ) ; } else { setWriter ( createWriter ( new SystemOutStream ( ) ) ) ; } } else { if ( target . equals ( SYSTEM_ERR ) ) { setWriter ( createWriter ( unwrap ( System . err ) ) ) ;...
Prepares the appender for use .
126,461
protected static void loadProvider ( final URL url , final ClassLoader cl ) { try { final Properties props = PropertiesUtil . loadClose ( url . openStream ( ) , url ) ; if ( validVersion ( props . getProperty ( API_VERSION ) ) ) { final Provider provider = new Provider ( props , url , cl ) ; PROVIDERS . add ( provider ...
Loads an individual Provider implementation . This method is really only useful for the OSGi bundle activator and this class itself .
126,462
protected static void lazyInit ( ) { if ( instance == null ) { try { STARTUP_LOCK . lockInterruptibly ( ) ; try { if ( instance == null ) { instance = new ProviderUtil ( ) ; } } finally { STARTUP_LOCK . unlock ( ) ; } } catch ( final InterruptedException e ) { LOGGER . fatal ( "Interrupted before Log4j Providers could ...
Lazily initializes the ProviderUtil singleton .
126,463
public static Object [ ] getAll ( final Supplier < ? > ... suppliers ) { if ( suppliers == null ) { return null ; } final Object [ ] result = new Object [ suppliers . length ] ; for ( int i = 0 ; i < result . length ; i ++ ) { result [ i ] = get ( suppliers [ i ] ) ; } return result ; }
Converts an array of lambda expressions into an array of their evaluation results .
126,464
public static Message getMessage ( final Supplier < ? > supplier , final MessageFactory messageFactory ) { if ( supplier == null ) { return null ; } final Object result = supplier . get ( ) ; return result instanceof Message ? ( Message ) result : messageFactory . newMessage ( result ) ; }
Returns a Message either the value supplied by the specified function or a new Message created by the specified Factory .
126,465
protected Appender findAppenderByName ( Document doc , String appenderName ) { Appender appender = ( Appender ) appenderBag . get ( appenderName ) ; if ( appender != null ) { return appender ; } else { Element element = null ; NodeList list = doc . getElementsByTagName ( "appender" ) ; for ( int t = 0 ; t < list . getL...
Used internally to parse appenders by IDREF name .
126,466
protected Appender findAppenderByReference ( Element appenderRef ) { String appenderName = subst ( appenderRef . getAttribute ( REF_ATTR ) ) ; Document doc = appenderRef . getOwnerDocument ( ) ; return findAppenderByName ( doc , appenderName ) ; }
Used internally to parse appenders by IDREF element .
126,467
private static void parseUnrecognizedElement ( final Object instance , final Element element , final Properties props ) throws Exception { boolean recognized = false ; if ( instance instanceof UnrecognizedElementHandler ) { recognized = ( ( UnrecognizedElementHandler ) instance ) . parseUnrecognizedElement ( element , ...
Delegates unrecognized content to created instance if it supports UnrecognizedElementParser .
126,468
private static void quietParseUnrecognizedElement ( final Object instance , final Element element , final Properties props ) { try { parseUnrecognizedElement ( instance , element , props ) ; } catch ( Exception ex ) { LogLog . error ( "Error in extension content: " , ex ) ; } }
Delegates unrecognized content to created instance if it supports UnrecognizedElementParser and catches and logs any exception .
126,469
protected Appender parseAppender ( Element appenderElement ) { String className = subst ( appenderElement . getAttribute ( CLASS_ATTR ) ) ; LogLog . debug ( "Class name: [" + className + ']' ) ; try { Object instance = Loader . loadClass ( className ) . newInstance ( ) ; Appender appender = ( Appender ) instance ; Prop...
Used internally to parse an appender element .
126,470
protected void parseFilters ( Element element , Appender appender ) { String clazz = subst ( element . getAttribute ( CLASS_ATTR ) ) ; Filter filter = ( Filter ) OptionConverter . instantiateByClassName ( clazz , Filter . class , null ) ; if ( filter != null ) { PropertySetter propSetter = new PropertySetter ( filter )...
Used internally to parse a filter element .
126,471
protected void parseCategory ( Element loggerElement ) { String catName = subst ( loggerElement . getAttribute ( NAME_ATTR ) ) ; Logger cat ; String className = subst ( loggerElement . getAttribute ( CLASS_ATTR ) ) ; if ( EMPTY_STR . equals ( className ) ) { LogLog . debug ( "Retreiving an instance of org.apache.log4j....
Used internally to parse an category element .
126,472
protected void parseCategoryFactory ( Element factoryElement ) { String className = subst ( factoryElement . getAttribute ( CLASS_ATTR ) ) ; if ( EMPTY_STR . equals ( className ) ) { LogLog . error ( "Category Factory tag " + CLASS_ATTR + " attribute not found." ) ; LogLog . debug ( "No Category Factory configured." ) ...
Used internally to parse the category factory element .
126,473
protected void parseRoot ( Element rootElement ) { Logger root = repository . getRootLogger ( ) ; synchronized ( root ) { parseChildrenOfLoggerElement ( rootElement , root , true ) ; } }
Used internally to parse the roor category element .
126,474
protected void parseChildrenOfLoggerElement ( Element catElement , Logger cat , boolean isRoot ) { PropertySetter propSetter = new PropertySetter ( cat ) ; cat . removeAllAppenders ( ) ; NodeList children = catElement . getChildNodes ( ) ; final int length = children . getLength ( ) ; for ( int loop = 0 ; loop < length...
Used internally to parse the children of a category element .
126,475
protected Layout parseLayout ( Element layout_element ) { String className = subst ( layout_element . getAttribute ( CLASS_ATTR ) ) ; LogLog . debug ( "Parsing layout of class: \"" + className + "\"" ) ; try { Object instance = Loader . loadClass ( className ) . newInstance ( ) ; Layout layout = ( Layout ) instance ; P...
Used internally to parse a layout element .
126,476
protected void parseLevel ( Element element , Logger logger , boolean isRoot ) { String catName = logger . getName ( ) ; if ( isRoot ) { catName = "root" ; } String priStr = subst ( element . getAttribute ( VALUE_ATTR ) ) ; LogLog . debug ( "Level value for " + catName + " is [" + priStr + "]." ) ; if ( INHERITED . eq...
Used internally to parse a level element .
126,477
public void doConfigure ( final InputStream inputStream , LoggerRepository repository ) throws FactoryConfigurationError { ParseAction action = new ParseAction ( ) { public Document parse ( final DocumentBuilder parser ) throws SAXException , IOException { InputSource inputSource = new InputSource ( inputStream ) ; inp...
Configure log4j by reading in a log4j . dtd compliant XML configuration file .
126,478
public static String subst ( final String value , final Properties props ) { try { return OptionConverter . substVars ( value , props ) ; } catch ( IllegalArgumentException e ) { LogLog . warn ( "Could not perform variable substitution." , e ) ; return value ; } }
Substitutes property value for any references in expression .
126,479
public static void setParameter ( final Element elem , final PropertySetter propSetter , final Properties props ) { String name = subst ( elem . getAttribute ( "name" ) , props ) ; String value = ( elem . getAttribute ( "value" ) ) ; value = subst ( OptionConverter . convertSpecialChars ( value ) , props ) ; propSetter...
Sets a parameter based from configuration file content .
126,480
public static OptionHandler parseElement ( final Element element , final Properties props , final Class expectedClass ) throws Exception { String clazz = subst ( element . getAttribute ( "class" ) , props ) ; Object instance = OptionConverter . instantiateByClassName ( clazz , expectedClass , null ) ; if ( instance ins...
Creates an OptionHandler and processes any nested param elements but does not call activateOptions . If the class also supports UnrecognizedElementParser the parseUnrecognizedElement method will be call for any child elements other than param .
126,481
public String getFormattedStatus ( ) { final StringBuilder sb = new StringBuilder ( ) ; final SimpleDateFormat format = new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss,SSS" ) ; sb . append ( format . format ( new Date ( timestamp ) ) ) ; sb . append ( SPACE ) ; sb . append ( getThreadName ( ) ) ; sb . append ( SPACE ) ; sb...
Formats the StatusData for viewing .
126,482
public static void putAll ( final Map < String , String > m ) { if ( contextMap instanceof ThreadContextMap2 ) { ( ( ThreadContextMap2 ) contextMap ) . putAll ( m ) ; } else if ( contextMap instanceof DefaultThreadContextMap ) { ( ( DefaultThreadContextMap ) contextMap ) . putAll ( m ) ; } else { for ( final Map . Entr...
Puts all given context map entries into the current thread s context map .
126,483
public static Map < String , String > getImmutableContext ( ) { final Map < String , String > map = contextMap . getImmutableMapOrNull ( ) ; return map == null ? EMPTY_MAP : map ; }
Returns an immutable view of the current thread s context Map .
126,484
public static ContextStack getImmutableStack ( ) { final ContextStack result = contextStack . getImmutableStackOrNull ( ) ; return result == null ? EMPTY_STACK : result ; }
Gets an immutable copy of this current thread s context stack .
126,485
public static void setStack ( final Collection < String > stack ) { if ( stack . isEmpty ( ) || ! useStack ) { return ; } contextStack . clear ( ) ; contextStack . addAll ( stack ) ; }
Sets this thread s stack .
126,486
public static void push ( final String message , final Object ... args ) { contextStack . push ( ParameterizedMessage . format ( message , args ) ) ; }
Pushes new diagnostic context information for the current thread .
126,487
protected final void parseFileNamePattern ( ) { List converters = new ArrayList ( ) ; List fields = new ArrayList ( ) ; ExtrasPatternParser . parse ( fileNamePatternStr , converters , fields , null , ExtrasPatternParser . getFileNamePatternRules ( ) ) ; patternConverters = new PatternConverter [ converters . size ( ) ]...
Parse file name pattern .
126,488
protected final void formatFileName ( final Object obj , final StringBuffer buf ) { for ( int i = 0 ; i < patternConverters . length ; i ++ ) { int fieldStart = buf . length ( ) ; patternConverters [ i ] . format ( obj , buf ) ; if ( patternFields [ i ] != null ) { patternFields [ i ] . format ( fieldStart , buf ) ; } ...
Format file name .
126,489
public void animateProgressFill ( int animateTo ) { mAnimationHandler . removeMessages ( 0 ) ; if ( animateTo > mMax || animateTo < 0 ) { throw new IllegalArgumentException ( String . format ( "Animation progress (%d) is greater than the max progress (%d) or lower than 0 " , animateTo , mMax ) ) ; } mAnimationHandler ....
Animates a progress fill of the view using a Handler .
126,490
public void setTextSize ( int sizeSp ) { mTextSize = sizeSp * mDisplayMetrics . scaledDensity ; mTextPaint . setTextSize ( mTextSize ) ; invalidate ( ) ; }
Sets the text size .
126,491
public void setStrokeWidth ( int widthDp ) { mStrokeWidth = widthDp * mDisplayMetrics . density ; mStrokePaint . setStrokeWidth ( mStrokeWidth ) ; invalidate ( ) ; }
Set the stroke width .
126,492
public Lyrics getLyrics ( int trackID ) throws MusixMatchException { Lyrics lyrics = null ; LyricsGetMessage message = null ; Map < String , Object > params = new HashMap < String , Object > ( ) ; params . put ( Constants . API_KEY , apiKey ) ; params . put ( Constants . TRACK_ID , new String ( "" + trackID ) ) ; Strin...
Get Lyrics for the specific trackID .
126,493
public Snippet getSnippet ( int trackID ) throws MusixMatchException { Snippet snippet = null ; SnippetGetMessage message = null ; Map < String , Object > params = new HashMap < String , Object > ( ) ; params . put ( Constants . API_KEY , apiKey ) ; params . put ( Constants . TRACK_ID , new String ( "" + trackID ) ) ; ...
Get Snippet for the specified trackID .
126,494
public Subtitle getSubtitle ( int trackID ) throws MusixMatchException { Subtitle subtitle = null ; SubtitleGetMessage message = null ; Map < String , Object > params = new HashMap < String , Object > ( ) ; params . put ( Constants . API_KEY , apiKey ) ; params . put ( Constants . TRACK_ID , new String ( "" + trackID )...
Get Subtitle for the specific trackID .
126,495
public List < Track > searchTracks ( String q , String q_artist , String q_track , int page , int pageSize , boolean f_has_lyrics ) throws MusixMatchException { List < Track > trackList = null ; TrackSeachMessage message = null ; Map < String , Object > params = new HashMap < String , Object > ( ) ; params . put ( Cons...
Search tracks using the given criteria .
126,496
public Track getTrack ( int trackID ) throws MusixMatchException { Track track = new Track ( ) ; Map < String , Object > params = new HashMap < String , Object > ( ) ; params . put ( Constants . API_KEY , apiKey ) ; params . put ( Constants . TRACK_ID , new String ( "" + trackID ) ) ; track = getTrackResponse ( Methods...
Get the track details using the specified trackId .
126,497
public Track getMatchingTrack ( String q_track , String q_artist ) throws MusixMatchException { Track track = new Track ( ) ; Map < String , Object > params = new HashMap < String , Object > ( ) ; params . put ( Constants . API_KEY , apiKey ) ; params . put ( Constants . QUERY_TRACK , q_track ) ; params . put ( Constan...
Get the most matching track which was retrieved using the search .
126,498
private Track getTrackResponse ( String methodName , Map < String , Object > params ) throws MusixMatchException { Track track = new Track ( ) ; String response = null ; TrackGetMessage message = null ; response = MusixMatchRequest . sendRequest ( Helper . getURLString ( methodName , params ) ) ; Gson gson = new Gson (...
Returns the track response which was returned through the query .
126,499
private void handleErrorResponse ( String jsonResponse ) throws MusixMatchException { StatusCode statusCode ; Gson gson = new Gson ( ) ; System . out . println ( jsonResponse ) ; ErrorMessage errMessage = gson . fromJson ( jsonResponse , ErrorMessage . class ) ; int responseCode = errMessage . getMessageContainer ( ) ....
Handle the error response .