/** * Not intstantiable because there is more than one Flintstone implementation bean inside the Spring context. */ public class Bedrock { @Inject private Flintstone citizen; }
@Inject public TooManyAutobuildConstructorsBean(String foo) { this(foo, null); }
public class FailedInjectDemo { @Inject private StringBuffer buffer; }
public class MessageAccessImpl implements MessageAccess { @Inject private Messages messages; public String getStatusMessage() { return messages.get("app-catalog-status"); } }
public class Index { @Inject private ViaFactory viaFactory; public String getMessage() { return viaFactory.getMessage(); } }
public class UserDAOImpl implements UserDAO { @Inject private EntityManager entityManager; @Override public void persist(Object entity) { entityManager.persist(entity); } }
@Inject public InjectoBean(String foo) { this(foo, null); }
/** * Store a simple error message in the {@link AlertManager}. */ public class ErrorComponent { @Inject private AlertManager alertManager; @SetupRender void addErrorMessage() { alertManager.alert(Duration.SINGLE, Severity.ERROR, "Error from ErrorComponent"); } }
public class TestPageForLocale { @Inject private PersistentLocale persistentLocale; @OnEvent(component = "changeLocale") public void changeLocaleToFrench() { persistentLocale.set(Locale.FRENCH); } }
@Autowired public UpcaseImpl(@Inject StringTransformer transformer) { this.transformer = transformer; }
public class TestPageForAsset { @Inject @Path("context:css/test.css") private Asset asset; public String getStylePath() { return asset.toClientURL(); } }
public class TestOnlyServiceDemo { @Property @Inject private TestOnly service; }
public class ReloadDemo { @Property @Inject private Reloadable reloadable; }
public class Inner { @Parameter private String innerValue; @Inject private ComponentResources resources; void beginRender(MarkupWriter writer) { writer.writef("[ value: %s, bound: %s ]", innerValue, resources.isBound("innerValue")); } }
public class InjectMessagesDemo { @Property @Inject private MessageAccess access; }
public BaseURLSourceImpl(Request request, @Inject @Symbol(SymbolConstants.HOSTNAME) String hostname, @Symbol(SymbolConstants.HOSTPORT) int hostPort, @Symbol(SymbolConstants.HOSTPORT_SECURE) int secureHostPort) { this.request = request; this.hostname = hostname; this.hostPort = hostPort; this.secureHostPort = secureHostPort; }
public class Bootstrap { @Inject private RequestGlobals requestGlobals; @Parameter @Property private String build; @Parameter @Property private Boolean nocache; public String getBody() { BootstrapComponent bootstrapComponent = new BootstrapComponent(requestGlobals.getHTTPServletRequest()); if (nocache != null && nocache) bootstrapComponent.setNoCache(true); return bootstrapComponent.getJavaScript(); } }
public class GridRemoveReorderDemo { @Property @Inject private MusicLibrary library; @Property private Track track; }
public class ZoneFormUpdateDemo { @Property @Persist(PersistenceConstants.FLASH) private String value; @Inject private Block fields; Object onActionFromUpdate() { return fields; } }
public class LeanGridDemo { @Property @Inject private MusicLibrary library; @Property private Track track; @Property private int rowIndex; @Property private int columnIndex; }