in commons-digester3-core/src/main/java/org/apache/commons/digester3/FactoryCreateRule.java [220:276]
public void begin( final String namespace, final String name, final Attributes attributes )
throws Exception
{
if ( ignoreCreateExceptions )
{
if ( exceptionIgnoredStack == null )
{
exceptionIgnoredStack = new Stack<>();
}
try
{
final Object instance = getFactory( attributes ).createObject( attributes );
if ( getDigester().getLogger().isDebugEnabled() )
{
getDigester().getLogger().debug( format( "[FactoryCreateRule]{%s} New %s",
getDigester().getMatch(),
instance == null ? "null object"
: instance.getClass().getName() ) );
}
getDigester().push( instance );
exceptionIgnoredStack.push( Boolean.FALSE );
}
catch ( final Exception e )
{
// log message and error
if ( getDigester().getLogger().isInfoEnabled() )
{
getDigester().getLogger().info( format( "[FactoryCreateRule]{%s} Create exception ignored: %s",
getDigester().getMatch(),
e.getMessage() == null ? e.getClass().getName()
: e.getMessage() ) );
if ( getDigester().getLogger().isDebugEnabled() )
{
getDigester().getLogger().debug( "[FactoryCreateRule] Ignored exception:", e );
}
}
exceptionIgnoredStack.push( Boolean.TRUE );
}
}
else
{
final Object instance = getFactory( attributes ).createObject( attributes );
if ( getDigester().getLogger().isDebugEnabled() )
{
getDigester().getLogger().debug( format( "[FactoryCreateRule]{%s} New %s",
getDigester().getMatch(),
instance == null ? "null object"
: instance.getClass().getName() ) );
}
getDigester().push( instance );
}
}