Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts2.views.gxp
Class GxpInstance

    java.lang.Object
      org.apache.struts2.views.gxp.AbstractGxp<com.google.gxp.html.HtmlClosure>
          org.apache.struts2.views.gxp.Gxp
              org.apache.struts2.views.gxp.GxpInstance

    public class GxpInstance

extends Gxp

Struts 2 to GXP adapter that uses instances of GXP Interfaces, as created by the `ObjectFactory`. Can be used to write a GXP or create a HtmlClosure. Pulls non-constructor GXP parameters from Struts 2 value stack.

Author:
  David P. Baker

Method Summary
`Class<?>` | `getGxpClass()`
`protected Object` | `getGxpInstance()`
`static GxpInstance` | `getInstance(Class gxpClass)` Looks up `GxpInstance` instance for the given GXP class.
`static GxpInstance` | `getInstance(String gxpPath)` Looks up Gxp instance for GXP with given path.
`void` | `setObjectFactory(com.opensymphony.xwork2.ObjectFactory objectFactory)`

Methods inherited from class org.apache.struts2.views.gxp.AbstractGxp
`getArgs, getGxpClassForPath, getGxpClosure, getGxpClosure, getOverrides, getParams, lookupMethodByName, setValueStackFactory, write, write`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getGxpInstance

    protected Object getGxpInstance()

  This implementation uses the `ObjectFactory` to try to create an instance of the `Interface` class that is nested within the GXP class. If that doesn't work, it falls back to trying to use the `ObjectFactory` to create an instance of the nested `Instance` class, in case there is no binding for the `Interface`.

  Overrides:
    `getGxpInstance` in class `AbstractGxp<com.google.gxp.html.HtmlClosure>`
  Returns:
    the object on which to call the write and getGxpClosure methods. If the methods are static, this can return `null`

### getGxpClass

    public Class<?> getGxpClass()

  Overrides:
    `getGxpClass` in class `AbstractGxp<com.google.gxp.html.HtmlClosure>`

### getInstance

    public static GxpInstance getInstance(String gxpPath)

  Looks up Gxp instance for GXP with given path.

### getInstance

    public static GxpInstance getInstance(Class gxpClass)

  Looks up `GxpInstance` instance for the given GXP class.

### setObjectFactory

    public void setObjectFactory(com.opensymphony.xwork2.ObjectFactory objectFactory)

Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000–2018 Apache Software Foundation. All rights reserved.