1 15 package org.apache.tapestry.pageload; 16 17 import org.apache.hivemind.HiveMind; 18 import org.apache.hivemind.Location; 19 import org.apache.hivemind.impl.MessageFormatter; 20 import org.apache.tapestry.IBinding; 21 import org.apache.tapestry.IComponent; 22 import org.apache.tapestry.spec.IContainedComponent; 23 24 30 class PageloadMessages 31 { 32 protected static MessageFormatter _formatter = new MessageFormatter(PageloadMessages.class, 33 "PageloadStrings"); 34 35 static String parameterMustHaveNoDefaultValue(IComponent component, String name) 36 { 37 return _formatter.format( 38 "parameter-must-have-no-default-value", 39 component.getExtendedId(), 40 name); 41 } 42 43 static String unableToInitializeProperty(String propertyName, IComponent component, 44 Throwable cause) 45 { 46 return _formatter.format("unable-to-initialize-property", propertyName, component, cause); 47 } 48 49 static String requiredParameterNotBound(String name, IComponent component) 50 { 51 return _formatter.format("required-parameter-not-bound", name, component.getExtendedId()); 52 } 53 54 static String inheritInformalInvalidComponentFormalOnly(IComponent component) 55 { 56 return _formatter.format("inherit-informal-invalid-component-formal-only", component 57 .getExtendedId()); 58 } 59 60 static String inheritInformalInvalidContainerFormalOnly(IComponent container, 61 IComponent component) 62 { 63 return _formatter.format("inherit-informal-invalid-container-formal-only", container 64 .getExtendedId(), component.getExtendedId()); 65 } 66 67 static String formalParametersOnly(IComponent component, String parameterName) 68 { 69 return _formatter 70 .format("formal-parameters-only", component.getExtendedId(), parameterName); 71 } 72 73 static String unableToInstantiateComponent(IComponent container, Throwable cause) 74 { 75 return _formatter.format( 76 "unable-to-instantiate-component", 77 container.getExtendedId(), 78 cause); 79 } 80 81 static String classNotComponent(Class componentClass) 82 { 83 return _formatter.format("class-not-component", componentClass.getName()); 84 } 85 86 static String unableToInstantiate(String className, Throwable cause) 87 { 88 return _formatter.format("unable-to-instantiate", className, cause); 89 } 90 91 static String pageNotAllowed(String componentId) 92 { 93 return _formatter.format("page-not-allowed", componentId); 94 } 95 96 static String classNotPage(Class componentClass) 97 { 98 return _formatter.format("class-not-page", componentClass.getName()); 99 } 100 101 static String defaultParameterName(String name) 102 { 103 return _formatter.format("default-parameter-name", name); 104 } 105 106 static String initializerName(String propertyName) 107 { 108 return _formatter.format("initializer-name", propertyName); 109 } 110 111 static String parameterName(String name) 112 { 113 return _formatter.format("parameter-name", name); 114 } 115 116 static String duplicateParameter(String parameterName, IBinding binding) 117 { 118 return _formatter.format("duplicate-parameter", parameterName, HiveMind 119 .getLocationString(binding)); 120 } 121 122 public static String usedParameterAlias(IContainedComponent contained, String name, 123 String parameterName, Location bindingLocation) 124 { 125 return _formatter.format("used-parameter-alias", new Object [] 126 { HiveMind.getLocationString(bindingLocation), contained.getType(), name, parameterName }); 127 } 128 129 public static String deprecatedParameter(String parameterName, Location location, 130 String componentType) 131 { 132 return _formatter.format("deprecated-parameter", parameterName, HiveMind 133 .getLocationString(location), componentType); 134 } 135 136 } | Popular Tags |