public PartialTileDefinition( Forward forward, Forwards forwards, Mapping mapping, String defaultBundleName) { Tile localTile = forward.tileProperties(); Tile globalTile = forwards.tileProperties(); path = forward.path(); extend = getDefinedValue(localTile.extend(), globalTile.extend(), getDefaultValue("extend")); title = getDefinedValue(localTile.title(), globalTile.title(), getDefaultValue("title")); customBundleName = getDefinedValue(localTile.bundle(), globalTile.bundle(), getDefaultValue("bundle")); this.defaultBundleName = (defaultBundleName == null) ? mapping.module() : defaultBundleName; for (Method tileMethod : tileMethods) { TileCustomPropertyName tileCustomProperty = tileMethod.getAnnotation(TileCustomPropertyName.class); String tileMethodName = (tileCustomProperty != null) ? tileCustomProperty.value() : tileMethod.getName(); String localValue = invokeAnnotationMethod(tileMethod, localTile); String globalValue = invokeAnnotationMethod(tileMethod, globalTile); attributeValues.put( tileMethodName, getDefinedValue(localValue, globalValue, (String) tileMethod.getDefaultValue())); attributeDefaults.put(tileMethodName, (String) tileMethod.getDefaultValue()); } }
private static void registerSuperclassForwards( final ActionMapping actionMapping, Class<?> superclass, Mapping mapping, String defaultResourcesName) { if (UPPER_BOUND_SUPERCLASSES.contains(superclass.getSimpleName())) { return; } Forwards forwards = superclass.getAnnotation(Forwards.class); if (forwards == null) { return; } for (final Forward forward : forwards.value()) { try { actionMapping.findForward(forward.name()); } catch (NullPointerException ex) { // Forward wasn't registered in any subclass, so register it. registerForward(actionMapping, forward, forwards, mapping, defaultResourcesName); } } registerSuperclassForwards( actionMapping, superclass.getSuperclass(), mapping, defaultResourcesName); }
private static void registerForward( final ActionMapping actionMapping, final Forward forward, Forwards forwards, Mapping mapping, String defaultResourcesName) { if (forward.useTile() && isSimplePageFile(forward.path())) { PartialTileDefinition tileDefinition = new PartialTileDefinition(forward, forwards, mapping, defaultResourcesName); FenixDefinitionsFactory.registerDefinition(tileDefinition); actionMapping.addForwardConfig( new ActionForward( forward.name(), tileDefinition.getName(), forward.redirect(), forward.contextRelative())); } else { // The forward is using an existing tile definition actionMapping.addForwardConfig( new ActionForward( forward.name(), forward.path(), forward.redirect(), forward.contextRelative())); } }