congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
BaseInspectionResultProcessor
Code IndexAdd Tabnine to your IDE (free)

How to use
BaseInspectionResultProcessor
in
org.metawidget.inspectionresultprocessor.impl

Best Java code snippets using org.metawidget.inspectionresultprocessor.impl.BaseInspectionResultProcessor (Showing top 17 results out of 315)

origin: org.metawidget.modules/metawidget-core

/**
 * Defers to <code>processAttributes</code> by default.
 *
 * @param attributes
 *            attributes of the trait being processed. Subclasses can modify this Map to
 *            modify the attributes
 * @param metawidget
 *            the parent Metawidget. Never null. May be useful to help processing
 * @param toInspect
 *            the Object being inspected. May be useful to help processing
 * @param type
 *            the type being inspected. May be useful to help processing
 * @param names
 *            the names being inspected. May be useful to help processing
 */
protected void processTrait( Map<String, String> attributes, M metawidget ) {
  processAttributes( attributes, metawidget );
}
origin: org.metawidget.modules/metawidget-all

@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();
  }
}
origin: org.metawidget.modules/metawidget-all

public Element processInspectionResultAsDom( Element inspectionResult, M metawidget, Object toInspect, String type, String... names ) {
  Element entity = XmlUtils.getFirstChildElement( inspectionResult );
  // Sanity check
  String elementName = entity.getNodeName();
  if ( !ENTITY.equals( elementName ) ) {
    throw InspectionResultProcessorException.newException( "Top-level element name should be " + ENTITY + ", not " + elementName );
  }
  Map<String, String> attributes = XmlUtils.getAttributesAsMap( entity );
  processEntity( attributes, metawidget, toInspect, type, names );
  XmlUtils.setMapAsAttributes( entity, attributes );
  processTraits( entity, metawidget, toInspect, type, names );
  return inspectionResult;
}
origin: org.metawidget.modules/metawidget-all

processTrait( attributes, metawidget );
XmlUtils.setMapAsAttributes( trait, attributes );
  processTraits( trait, metawidget, toInspect, type, ArrayUtils.add( names, attributes.get( NAME ) ) );
origin: org.metawidget.modules/metawidget-all

@Override
protected void processEntity( Map<String, String> attributes, UIMetawidget metawidget, Object toInspect, String type, String... names ) {
  FacesContext context = FacesContext.getCurrentInstance();
  if ( context == null ) {
    throw InspectionResultProcessorException.newException( "FacesContext not available to FacesInspectionResultProcessor" );
  }
  Map<String, Object> requestMap = null;
  try {
    if ( mInjectThis != null ) {
      requestMap = context.getExternalContext().getRequestMap();
      requestMap.put( UNDERSCORE_THIS_ATTRIBUTE, mInjectThis.traverse( toInspect, type, true, names ).getValue() );
    }
    super.processEntity( attributes, metawidget, toInspect, type, names );
  } finally {
    // UNDERSCORE_THIS_ATTRIBUTE should not be available outside of our particular
    // evaluation
    if ( requestMap != null ) {
      requestMap.remove( UNDERSCORE_THIS_ATTRIBUTE );
    }
  }
}
origin: org.metawidget.modules/metawidget-all

@Override
protected void processTraits( Element entity, UIMetawidget metawidget, Object toInspect, String type, String... names ) {
  FacesContext context = FacesContext.getCurrentInstance();
  if ( context == null ) {
    throw InspectionResultProcessorException.newException( "FacesContext not available to FacesInspectionResultProcessor" );
  }
  Map<String, Object> requestMap = null;
  try {
    if ( mInjectThis != null ) {
      requestMap = context.getExternalContext().getRequestMap();
      requestMap.put( UNDERSCORE_THIS_ATTRIBUTE, mInjectThis.traverse( toInspect, type, false, names ).getValue() );
    }
    super.processTraits( entity, metawidget, toInspect, type, names );
  } finally {
    // UNDERSCORE_THIS_ATTRIBUTE should not be available outside of our particular
    // evaluation
    if ( requestMap != null ) {
      requestMap.remove( UNDERSCORE_THIS_ATTRIBUTE );
    }
  }
}
origin: org.metawidget.modules/metawidget-core

public Element processInspectionResultAsDom( Element inspectionResult, M metawidget, Object toInspect, String type, String... names ) {
  Element entity = XmlUtils.getFirstChildElement( inspectionResult );
  // Sanity check
  String elementName = entity.getNodeName();
  if ( !ENTITY.equals( elementName ) ) {
    throw InspectionResultProcessorException.newException( "Top-level element name should be " + ENTITY + ", not " + elementName );
  }
  Map<String, String> attributes = XmlUtils.getAttributesAsMap( entity );
  processEntity( attributes, metawidget, toInspect, type, names );
  XmlUtils.setMapAsAttributes( entity, attributes );
  processTraits( entity, metawidget, toInspect, type, names );
  return inspectionResult;
}
origin: org.metawidget.modules/metawidget-core

processTrait( attributes, metawidget );
XmlUtils.setMapAsAttributes( trait, attributes );
  processTraits( trait, metawidget, toInspect, type, ArrayUtils.add( names, attributes.get( NAME ) ) );
origin: org.metawidget.modules.faces/metawidget-faces

@Override
protected void processEntity( Map<String, String> attributes, UIMetawidget metawidget, Object toInspect, String type, String... names ) {
  FacesContext context = FacesContext.getCurrentInstance();
  if ( context == null ) {
    throw InspectionResultProcessorException.newException( "FacesContext not available to FacesInspectionResultProcessor" );
  }
  Map<String, Object> requestMap = null;
  try {
    if ( mInjectThis != null ) {
      requestMap = context.getExternalContext().getRequestMap();
      requestMap.put( UNDERSCORE_THIS_ATTRIBUTE, mInjectThis.traverse( toInspect, type, true, names ).getValue() );
    }
    super.processEntity( attributes, metawidget, toInspect, type, names );
  } finally {
    // UNDERSCORE_THIS_ATTRIBUTE should not be available outside of our particular
    // evaluation
    if ( requestMap != null ) {
      requestMap.remove( UNDERSCORE_THIS_ATTRIBUTE );
    }
  }
}
origin: org.metawidget.modules.faces/metawidget-faces

@Override
protected void processTraits( Element entity, UIMetawidget metawidget, Object toInspect, String type, String... names ) {
  FacesContext context = FacesContext.getCurrentInstance();
  if ( context == null ) {
    throw InspectionResultProcessorException.newException( "FacesContext not available to FacesInspectionResultProcessor" );
  }
  Map<String, Object> requestMap = null;
  try {
    if ( mInjectThis != null ) {
      requestMap = context.getExternalContext().getRequestMap();
      requestMap.put( UNDERSCORE_THIS_ATTRIBUTE, mInjectThis.traverse( toInspect, type, false, names ).getValue() );
    }
    super.processTraits( entity, metawidget, toInspect, type, names );
  } finally {
    // UNDERSCORE_THIS_ATTRIBUTE should not be available outside of our particular
    // evaluation
    if ( requestMap != null ) {
      requestMap.remove( UNDERSCORE_THIS_ATTRIBUTE );
    }
  }
}
origin: org.metawidget.modules/metawidget-all

@Override
protected void processEntity( Map<String, String> attributes, M metawidget, Object toInspect, String type, String... names ) {
  JexlContext context = LOCAL_CONTEXT.get();
  try {
    context.set( THIS_ATTRIBUTE, mInjectThis.traverse( toInspect, type, true, names ).getValue() );
    super.processEntity( attributes, metawidget, toInspect, type, names );
  } finally {
    // THIS_ATTRIBUTE should not be available outside of our particular evaluation
    context.set( THIS_ATTRIBUTE, null );
  }
}
origin: org.metawidget.modules/metawidget-all

@Override
protected void processTraits( Element entity, M metawidget, Object toInspect, String type, String... names ) {
  JexlContext context = LOCAL_CONTEXT.get();
  try {
    context.set( THIS_ATTRIBUTE, mInjectThis.traverse( toInspect, type, false, names ).getValue() );
    super.processTraits( entity, metawidget, toInspect, type, names );
  } finally {
    // THIS_ATTRIBUTE should not be available outside of our particular evaluation
    context.set( THIS_ATTRIBUTE, null );
  }
}
origin: org.metawidget.modules/metawidget-all

/**
 * Defers to <code>processAttributes</code> by default.
 *
 * @param attributes
 *            attributes of the entity being processed. Subclasses can modify this Map to
 *            modify the attributes
 * @param metawidget
 *            the parent Metawidget. Never null. May be useful to help processing
 * @param toInspect
 *            the Object being inspected. May be useful to help processing
 * @param type
 *            the type being inspected. May be useful to help processing
 * @param names
 *            the names being inspected. May be useful to help processing
 */
protected void processEntity( Map<String, String> attributes, M metawidget, Object toInspect, String type, String... names ) {
  processAttributes( attributes, metawidget );
}
origin: org.metawidget.modules/metawidget-core

/**
 * 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 );
}
origin: org.metawidget.modules/metawidget-all

/**
 * Defers to <code>processAttributes</code> by default.
 *
 * @param attributes
 *            attributes of the trait being processed. Subclasses can modify this Map to
 *            modify the attributes
 * @param metawidget
 *            the parent Metawidget. Never null. May be useful to help processing
 * @param toInspect
 *            the Object being inspected. May be useful to help processing
 * @param type
 *            the type being inspected. May be useful to help processing
 * @param names
 *            the names being inspected. May be useful to help processing
 */
protected void processTrait( Map<String, String> attributes, M metawidget ) {
  processAttributes( attributes, metawidget );
}
origin: org.metawidget.modules/metawidget-all

/**
 * 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 );
}
origin: org.metawidget.modules/metawidget-core

/**
 * Defers to <code>processAttributes</code> by default.
 *
 * @param attributes
 *            attributes of the entity being processed. Subclasses can modify this Map to
 *            modify the attributes
 * @param metawidget
 *            the parent Metawidget. Never null. May be useful to help processing
 * @param toInspect
 *            the Object being inspected. May be useful to help processing
 * @param type
 *            the type being inspected. May be useful to help processing
 * @param names
 *            the names being inspected. May be useful to help processing
 */
protected void processEntity( Map<String, String> attributes, M metawidget, Object toInspect, String type, String... names ) {
  processAttributes( attributes, metawidget );
}
org.metawidget.inspectionresultprocessor.implBaseInspectionResultProcessor

Javadoc

Convenience implementation for InspectionResultProcessors.

Most used methods

  • processEntity
    Defers to processAttributes by default.
  • processTraits
    Process the traits of the given entity. Subclasses may find it useful to override this method to per
  • processAttributes
    Process the given attributes (which may belong to either entity, property or action). Does nothing b
  • processInspectionResultAsDom
  • processTrait
    Defers to processAttributes by default.

Popular in Java

  • Reading from database using SQL prepared statement
  • startActivity (Activity)
  • requestLocationUpdates (LocationManager)
  • setContentView (Activity)
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JFileChooser (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now