public FieldConduit<Object> get(InstanceContext context) { final ComponentResources resources = context.get(ComponentResources.class); return new ReadOnlyComponentFieldConduit(resources, fieldName) { public Object get(Object instance, InstanceContext context) { return resources.getEmbeddedComponent(id); } }; } };
public static Object getFromInstanceContext(InstanceContext context, String javaName) { ClassLoader loader = context.getInstanceType().getClassLoader(); try { Class valueType = toClass(loader, javaName); return context.get(valueType); } catch (ClassNotFoundException ex) { throw new RuntimeException(ex); } }
public Asset[] get(InstanceContext context) { ComponentResources resources = context.get(ComponentResources.class); return convertPathsToAssetArray(resources, expandedPaths, libraryName); } });
public static Object getFromInstanceContext(InstanceContext context, String javaName) { ClassLoader loader = context.getInstanceType().getClassLoader(); try { Class valueType = toClass(loader, javaName); return context.get(valueType); } catch (ClassNotFoundException ex) { throw new RuntimeException(ex); } }
public FieldConduit get(InstanceContext context) { ComponentResources resources = context.get(ComponentResources.class); final InternalComponentResources icr = (InternalComponentResources) resources; return new ReadOnlyComponentFieldConduit(resources, fieldName) { public Object get(Object instance, InstanceContext context) { return icr.getMixinByClassName(mixinClassName); } }; } };
public FieldConduit<Object> get(InstanceContext context) { InternalComponentResources resources = context.get(InternalComponentResources.class); return new PersistentFieldConduit(resources, logicalFieldName, defaultValue); } };
public FieldConduit<Object> get(InstanceContext context) { ComponentResources resources = context.get(ComponentResources.class); return new InjectedComponentFieldValueConduit(resources, fieldName, type, componentId); } };
public Object get(Object instance, InstanceContext context) { ComponentResources resources = context.get(ComponentResources.class); return resources.getBlock(blockId); } };
public Asset get(InstanceContext context) { ComponentResources resources = context.get(ComponentResources.class); // Note how this works: the resources represents the actual instantiated class, and the libraryName // comes from the componentModel, potentially, the componentModel of a base class (which may have // a different library name than the subclass). return assetSource.getComponentAsset(resources, assetPath, libraryName); } };
public void onConstruct(Object instance, InstanceContext context) { InternalComponentResources resources = context.get(InternalComponentResources.class); resources.addPageResetListener((PageResetListener) instance); } };
public void onConstruct(Object instance, InstanceContext context) { InternalComponentResources resources = context.get(InternalComponentResources.class); resources.addPageLifecycleListener((PageLifecycleListener) instance); } };
abstract T get(ComponentResources resources); }
public FieldConduit<Object> get(InstanceContext context) { final Class fieldType = cache.forName(fieldTypeName); final ComponentResources resources = context.get(ComponentResources.class); return new ReadOnlyComponentFieldConduit(resources, fieldName) { public Object get(Object instance, InstanceContext context) { Component container = resources.getContainer(); if (!fieldType.isInstance(container)) { String message = String.format( "Component %s (type %s) is not assignable to field %s.%s (of type %s).", container .getComponentResources().getCompleteId(), container.getClass().getName(), resources.getComponentModel() .getComponentClassName(), fieldName, fieldTypeName); throw new RuntimeException(message); } return container; } }; } };
public FieldConduit<Object> get(InstanceContext context) { Object fieldDefaultValue = classCache.defaultValueForType(fieldType); InternalComponentResources resources = context.get(InternalComponentResources.class); return new UnclaimedFieldConduit(resources, perThreadManager.createValue(), fieldDefaultValue); } };
public void advise(MethodInvocation invocation) { ComponentResources resources = invocation.getInstanceContext().get(ComponentResources.class); for (ComponentIdValidator validator : validators) { validator.validate(resources); } invocation.proceed(); } }
public void advise(MethodInvocation invocation) { invocation.proceed(); if (invocation.didThrowCheckedException()) return; ComponentResources resources = invocation.getInstanceContext().get(ComponentResources.class); resources.discardPersistentFieldChanges(); } };
public FieldConduit<Object> get(InstanceContext context) { ComponentResources resources = context.get(ComponentResources.class); try { return createConduit(resources, fieldTypeName, fieldName, possibleNames); } catch (Exception ex) { throw new TapestryException(String.format( "Failure binding parameter field '%s' of mixin %s (type %s): %s", fieldName, resources .getCompleteId(), resources.getComponentModel().getComponentClassName(), ExceptionUtils.toMessage(ex)), ex); } }
public void advise(MethodInvocation invocation) { ComponentResources resources = invocation.getInstanceContext().get(ComponentResources.class); Binding binding = bindingSource.newBinding("@Cached watch", resources, BindingConstants.PROP, watch); bindingFieldHandle.set(invocation.getInstance(), binding); invocation.proceed(); } });
public ParameterConduit get(InstanceContext context) final InternalComponentResources icr = context.get(InternalComponentResources.class);