@Override public Element processInspectionResultAsDom( Element inspectionResult, M metawidget, Object toInspect, String type, String... names ) { try { LOCAL_CONTEXT.set( createContext( metawidget ) ); return super.processInspectionResultAsDom( inspectionResult, metawidget, toInspect, type, names ); } finally { LOCAL_CONTEXT.remove(); } }
/** * Process the given inspection result in context of the given Metawidget. * <p> * This method is marked <code>final</code> because most Metawidget implementations will call * <code>processInspectionResultAsDom</code> directly instead. So subclasses need to override * <code>processInspectionResultAsDom</code>, not <code>processInspectionResult</code>. */ public final String processInspectionResult( String inspectionResult, M metawidget, Object toInspect, String type, String... names ) { Document document = XmlUtils.documentFromString( inspectionResult ); Element inspectionResultRoot = document.getDocumentElement(); Element newInspectionResultRoot = processInspectionResultAsDom( inspectionResultRoot, metawidget, toInspect, type, names ); return XmlUtils.documentToString( newInspectionResultRoot.getOwnerDocument(), false ); }
/** * Process the given inspection result in context of the given Metawidget. * <p> * This method is marked <code>final</code> because most Metawidget implementations will call * <code>processInspectionResultAsDom</code> directly instead. So subclasses need to override * <code>processInspectionResultAsDom</code>, not <code>processInspectionResult</code>. */ public final String processInspectionResult( String inspectionResult, M metawidget, Object toInspect, String type, String... names ) { Document document = XmlUtils.documentFromString( inspectionResult ); Element inspectionResultRoot = document.getDocumentElement(); Element newInspectionResultRoot = processInspectionResultAsDom( inspectionResultRoot, metawidget, toInspect, type, names ); return XmlUtils.documentToString( newInspectionResultRoot.getOwnerDocument(), false ); }