public class HolderPage { @Property private String value; }
private PropertyAccessType toType(PlasticField field) { Property annotation = field.getAnnotation(Property.class); boolean read = annotation.read(); boolean write = annotation.write(); if (read && write) return PropertyAccessType.READ_WRITE; if (read) return PropertyAccessType.READ_ONLY; if (write) return PropertyAccessType.WRITE_ONLY; throw new IllegalArgumentException(String.format( "@Property annotation on %s.%s should have either read() or write() enabled.", field.getPlasticClass() .getClassName(), field.getName())); } }
public class FormFieldOutsideForm { @Property private int quantity; }
public class GenericTypeDemo { private Set<Long> setOfLongs; @Property private Map<String, String> mapOfStrings; public List<List<Date>> getListOfListOfDates() { throw new UnsupportedOperationException(); } public void setSetOfLongs(Set<Long> setOfLongs) { throw new UnsupportedOperationException(); } }
public class MessageConstraintGeneratorDemo { @Property private Pet pet; }
public class InplaceGridInLoopDemo extends GridDemo { @Property protected int index; public String getContainerClass() { return "grid" + index; } }
/** * Testing loop with mixins */ public class LoopWithMixinDemo { @Property private int value; }
public class BypassActivationTarget { @Property private boolean activated; void onActivate() { activated = true; } }
public class DupeMixinDemo { @Property private String value; }
public class ObjectEditorDemo { @Property Address address; void onSuccess() { } }
public class GetterMethodAlreadyExists { @Property private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } }
public class ActionDemo { @Property private Long number; @OnEvent(component = "actionlink", value = "action") public void onAction(Long number) { this.number = number; } public void onActivate(Long number) { this.number = number; } public Long onPassivate() { return number; } }
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(); } }
/** * Base page for Tapestry internal pages, that should suppress any application changes to the core stack's CSS. * CSS from the core stack is suppressed, instead the internal stack (which exists for just this purpose) * is imported. * * @since 5.4 */ public abstract class AbstractInternalPage { @Inject @Property(write = false) protected Request request; void setupRender() { request.setAttribute(InternalConstants.SUPPRESS_CORE_STYLESHEETS, true); } @Import(stack = "internal") void beginRender() { } }