public static String prettyPrintRule(Rule rule)
    {
        StringBuilder result = new StringBuilder();
        if (rule instanceof Context)
        {
            final Context context = (Context) rule;
            RuleProvider provider = (RuleProvider) context.get(RuleMetadataType.RULE_PROVIDER);

            if (provider != null && provider.getMetadata() != null)
            {
                result.append(provider.getMetadata().getPhase().getSimpleName()).append(" - ");
                result.append(provider.getMetadata().getID()).append(" - ");
            }

            if (rule.getId() != null)
                result.append(rule.getId());
        }

        return result.toString();
    }
public static String prettyPrintRule ( Rule rule ) { StringBuilder result = new StringBuilder ( ) ; if ( rule instanceof Context ) { final Context context = ( Context ) rule ; RuleProvider provider = ( RuleProvider ) context . get ( RuleMetadataType . RULE_PROVIDER ) ; if ( provider != null && provider . getMetadata ( ) != null ) { result . append ( provider . getMetadata ( ) . getPhase ( ) . getSimpleName ( ) ) . append ( " - " ) ; result . append ( provider . getMetadata ( ) . getID ( ) ) . append ( " - " ) ; } if ( rule . getId ( ) != null ) result . append ( rule . getId ( ) ) ; } return result . toString ( ) ; }
Describes given {@link Rule} as:
<p>
<code>ID: Phase - Provider [tags ...]".</code>