本文整理汇总了Java中org.apache.harmony.beans.internal.nls.Messages.getString方法的典型用法代码示例。如果您正苦于以下问题:Java Messages.getString方法的具体用法?Java Messages.getString怎么用?Java Messages.getString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.harmony.beans.internal.nls.Messages
的用法示例。
在下文中一共展示了Messages.getString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getChildBeanContextChild
import org.apache.harmony.beans.internal.nls.Messages; //导入方法依赖的package包/类
/**
* Returns the <code>BeanContextChild</code> related with the given child.
* <p>
* If the child implements <code>BeanContextChild</code>, it is returned.
* If the child implements <code>BeanContextProxy</code>, the proxy is returned.
* Otherwise, null is returned.</p>
*
* @param child a child
* @return the <code>BeanContextChild</code> related with the given child
* @throws IllegalStateException if the child implements both <code>BeanContextChild</code> and <code>BeanContextProxy</code>
*/
protected static final BeanContextChild getChildBeanContextChild(
Object child) {
if (child instanceof BeanContextChild) {
if (child instanceof BeanContextProxy) {
throw new IllegalArgumentException(
Messages.getString("beans.6C"));
}
return (BeanContextChild) child;
}
if (child instanceof BeanContextProxy) {
if (child instanceof BeanContextChild) {
throw new IllegalArgumentException(
Messages.getString("beans.6C"));
}
return ((BeanContextProxy) child).getBeanContextProxy();
}
return null;
}
示例2: PropertyDescriptor
import org.apache.harmony.beans.internal.nls.Messages; //导入方法依赖的package包/类
public PropertyDescriptor(String propertyName, Class<?> beanClass)
throws IntrospectionException {
if (beanClass == null) {
throw new IntrospectionException(Messages.getString("beans.03")); //$NON-NLS-1$
}
if (propertyName == null || propertyName.length() == 0) {
throw new IntrospectionException(Messages.getString("beans.04")); //$NON-NLS-1$
}
this.setName(propertyName);
try {
setReadMethod(beanClass,
createDefaultMethodName(propertyName, "is")); //$NON-NLS-1$
} catch (Exception e) {
setReadMethod(beanClass, createDefaultMethodName(propertyName,
"get")); //$NON-NLS-1$
}
setWriteMethod(beanClass, createDefaultMethodName(propertyName, "set")); //$NON-NLS-1$
}
示例3: setWriteMethod
import org.apache.harmony.beans.internal.nls.Messages; //导入方法依赖的package包/类
public void setWriteMethod(Method setter) throws IntrospectionException {
if (setter != null) {
int modifiers = setter.getModifiers();
if (!Modifier.isPublic(modifiers)) {
throw new IntrospectionException(Messages.getString("beans.05")); //$NON-NLS-1$
}
Class<?>[] parameterTypes = setter.getParameterTypes();
if (parameterTypes.length != 1) {
throw new IntrospectionException(Messages.getString("beans.06")); //$NON-NLS-1$
}
Class<?> parameterType = parameterTypes[0];
Class<?> propertyType = getPropertyType();
if (propertyType != null && !propertyType.equals(parameterType)) {
throw new IntrospectionException(Messages.getString("beans.07")); //$NON-NLS-1$
}
}
this.setter = setter;
}
示例4: findListenerMethodByName
import org.apache.harmony.beans.internal.nls.Messages; //导入方法依赖的package包/类
private Method findListenerMethodByName(String listenerMethodName)
throws IntrospectionException {
Method result = null;
Method[] methods = listenerType.getMethods();
for (Method method : methods) {
if (listenerMethodName.equals(method.getName())) {
Class<?>[] paramTypes = method.getParameterTypes();
if (paramTypes.length == 1
&& paramTypes[0].getName().endsWith("Event")) { //$NON-NLS-1$
result = method;
break;
}
}
}
if (null == result) {
throw new IntrospectionException(Messages.getString("beans.31", //$NON-NLS-1$
listenerMethodName, listenerType.getName()));
}
return result;
}
示例5: checkEventType
import org.apache.harmony.beans.internal.nls.Messages; //导入方法依赖的package包/类
/**
* Checks that given listener method has an argument of the valid type.
*
* @param eventSetName
* event set name
* @param listenerMethod
* listener method
* @throws IntrospectionException
* if check fails
*/
private static void checkEventType(String eventSetName,
Method listenerMethod) throws IntrospectionException {
Class<?>[] params = listenerMethod.getParameterTypes();
String firstParamTypeName = null;
String eventTypeName = prepareEventTypeName(eventSetName);
if (params.length > 0) {
firstParamTypeName = extractShortClassName(params[0]
.getName());
}
if (firstParamTypeName == null
|| !firstParamTypeName.equals(eventTypeName)) {
throw new IntrospectionException(Messages.getString("beans.51", //$NON-NLS-1$
listenerMethod.getName(), eventTypeName));
}
}
示例6: findAddRemoveListnerMethodWithLessCheck
import org.apache.harmony.beans.internal.nls.Messages; //导入方法依赖的package包/类
private Method findAddRemoveListnerMethodWithLessCheck(
Class<?> sourceClass, String methodName)
throws IntrospectionException {
Method[] methods = sourceClass.getMethods();
Method result = null;
for (Method method : methods) {
if (method.getName().equals(methodName)) {
Class<?>[] paramTypes = method.getParameterTypes();
if (paramTypes.length == 1) {
result = method;
break;
}
}
}
if (null == result) {
throw new IntrospectionException(Messages.getString("beans.31", //$NON-NLS-1$
methodName, listenerType.getName()));
}
return result;
}
示例7: serviceAvailable
import org.apache.harmony.beans.internal.nls.Messages; //导入方法依赖的package包/类
/**
* Notify all listeners and children that implements
* <code>BeanContextServices</code> of the event.
*
* @see com.googlecode.openbeans.beancontext.BeanContextServicesListener#serviceAvailable(com.googlecode.openbeans.beancontext.BeanContextServiceAvailableEvent)
*/
public void serviceAvailable(BeanContextServiceAvailableEvent event) {
if (null == event) {
throw new NullPointerException(Messages.getString("beans.1C")); //$NON-NLS-1$
}
if (services.containsKey(event.serviceClass)) {
return;
}
fireServiceAdded(event);
Object childs[] = copyChildren();
for (int i = 0; i < childs.length; i++) {
if (childs[i] instanceof BeanContextServices) {
((BeanContextServices) childs[i]).serviceAvailable(event);
}
}
}
示例8: setWriteMethod
import org.apache.harmony.beans.internal.nls.Messages; //导入方法依赖的package包/类
public void setWriteMethod(Method setter) throws IntrospectionException {
if (setter != null) {
int modifiers = setter.getModifiers();
if (!Modifier.isPublic(modifiers)) {
throw new IntrospectionException(Messages.getString("beans.05")); //$NON-NLS-1$
}
Class<?>[] parameterTypes = setter.getParameterTypes();
if (parameterTypes.length != 1) {
throw new IntrospectionException(Messages.getString("beans.06")); //$NON-NLS-1$
}
Class<?> parameterType = parameterTypes[0];
Class<?> propertyType = getPropertyType();
if (propertyType != null && !propertyType.equals(parameterType)) {
throw new IntrospectionException(Messages.getString("beans.07")); //$NON-NLS-1$
}
}
this.setter = setter;
}
示例9: EventSetDescriptor
import org.apache.harmony.beans.internal.nls.Messages; //导入方法依赖的package包/类
public EventSetDescriptor(Class<?> sourceClass, String eventSetName,
Class<?> listenerType, String listenerMethodName)
throws IntrospectionException {
checkNotNull(sourceClass, eventSetName, listenerType,
listenerMethodName);
setName(eventSetName);
this.listenerType = listenerType;
Method method = findListenerMethodByName(listenerMethodName);
checkEventType(eventSetName, method);
listenerMethodDescriptors = new ArrayList<MethodDescriptor>();
listenerMethodDescriptors.add(new MethodDescriptor(method));
addListenerMethod = findMethodByPrefix(sourceClass, "add", ""); //$NON-NLS-1$ //$NON-NLS-2$
removeListenerMethod = findMethodByPrefix(sourceClass, "remove", ""); //$NON-NLS-1$ //$NON-NLS-2$
if (addListenerMethod == null || removeListenerMethod == null) {
throw new IntrospectionException(Messages.getString("beans.38")); //$NON-NLS-1$
}
getListenerMethod = findMethodByPrefix(sourceClass, "get", "s"); //$NON-NLS-1$ //$NON-NLS-2$
unicast = isUnicastByDefault(addListenerMethod);
}
示例10: IndexedPropertyDescriptor
import org.apache.harmony.beans.internal.nls.Messages; //导入方法依赖的package包/类
/**
* Constructs a new instance of <code>IndexedPropertyDescriptor</code>.
*
* @param propertyName
* the specified indexed property's name.
* @param getter
* the array getter
* @param setter
* the array setter
* @param indexedGetter
* the indexed getter
* @param indexedSetter
* the indexed setter
* @throws IntrospectionException
*/
public IndexedPropertyDescriptor(String propertyName, Method getter,
Method setter, Method indexedGetter, Method indexedSetter)
throws IntrospectionException {
super(propertyName, getter, setter);
if (indexedGetter != null) {
internalSetIndexedReadMethod(indexedGetter);
internalSetIndexedWriteMethod(indexedSetter, true);
} else {
internalSetIndexedWriteMethod(indexedSetter, true);
internalSetIndexedReadMethod(indexedGetter);
}
if (!isCompatible()) {
// beans.57=Property type is incompatible with the indexed property type
throw new IntrospectionException(Messages.getString("beans.57")); //$NON-NLS-1$
}
}
示例11: releaseService
import org.apache.harmony.beans.internal.nls.Messages; //导入方法依赖的package包/类
/**
* Release a service which has been requested previously.
*
* @param child
* the child that request the service
* @param requestor
* the requestor object
* @param service
* the service instance
* @throws IllegalArgumentException
* if <code>child</code> is not a child of this context
*/
public void releaseService(BeanContextChild child, Object requestor,
Object service) {
if (child == null || requestor == null || service == null) {
throw new NullPointerException();
}
synchronized (globalHierarchyLock) {
BCSSChild bcssChild;
synchronized (children) {
bcssChild = (BCSSChild) children.get(child);
}
if (bcssChild == null) {
throw new IllegalArgumentException(
Messages.getString("beans.65"));
}
releaseServiceWithoutCheck(child, bcssChild, requestor, service,
false);
}
}
示例12: setReadMethod
import org.apache.harmony.beans.internal.nls.Messages; //导入方法依赖的package包/类
public void setReadMethod(Method getter) throws IntrospectionException {
if (getter != null) {
int modifiers = getter.getModifiers();
if (!Modifier.isPublic(modifiers)) {
throw new IntrospectionException(Messages.getString("beans.0A")); //$NON-NLS-1$
}
Class<?>[] parameterTypes = getter.getParameterTypes();
if (parameterTypes.length != 0) {
throw new IntrospectionException(Messages.getString("beans.08")); //$NON-NLS-1$
}
Class<?> returnType = getter.getReturnType();
if (returnType.equals(Void.TYPE)) {
throw new IntrospectionException(Messages.getString("beans.33")); //$NON-NLS-1$
}
Class<?> propertyType = getPropertyType();
if ((propertyType != null) && !returnType.equals(propertyType)) {
throw new IntrospectionException(Messages.getString("beans.09")); //$NON-NLS-1$
}
}
this.getter = getter;
}
示例13: findListenerMethodByName
import org.apache.harmony.beans.internal.nls.Messages; //导入方法依赖的package包/类
private Method findListenerMethodByName(String listenerMethodName)
throws IntrospectionException {
Method result = null;
Method[] methods = listenerType.getMethods();
for (Method method : methods) {
if (listenerMethodName.equals(method.getName())) {
Class<?>[] paramTypes = method.getParameterTypes();
if (paramTypes.length == 1
&& paramTypes[0].getName().endsWith("Event")) { //$NON-NLS-1$
result = method;
break;
}
}
}
if (null == result) {
throw new IntrospectionException(Messages.getString("custom.beans.31", //$NON-NLS-1$
listenerMethodName, listenerType.getName()));
}
return result;
}
示例14: toString
import org.apache.harmony.beans.internal.nls.Messages; //导入方法依赖的package包/类
@Override
public String toString() {
try {
StringBuilder sb = new StringBuilder();
if (!valueIsDefined) {
sb.append("<unbound>"); //$NON-NLS-1$
} else {
if (value == null) {
sb.append("null"); //$NON-NLS-1$
} else {
sb.append(convertClassName(value.getClass()));
}
}
sb.append('=');
sb.append(super.toString());
return sb.toString();
} catch (Exception e) {
return new String(Messages.getString("beans.0D", e.getClass())); //$NON-NLS-1$
}
}
示例15: setWriteMethod
import org.apache.harmony.beans.internal.nls.Messages; //导入方法依赖的package包/类
public void setWriteMethod(Method setter) throws IntrospectionException {
if (setter != null) {
int modifiers = setter.getModifiers();
if (!Modifier.isPublic(modifiers)) {
throw new IntrospectionException(Messages.getString("custom.beans.05")); //$NON-NLS-1$
}
Class<?>[] parameterTypes = setter.getParameterTypes();
if (parameterTypes.length != 1) {
throw new IntrospectionException(Messages.getString("custom.beans.06")); //$NON-NLS-1$
}
Class<?> parameterType = parameterTypes[0];
Class<?> propertyType = getPropertyType();
if (propertyType != null && !propertyType.equals(parameterType)) {
throw new IntrospectionException(Messages.getString("custom.beans.07")); //$NON-NLS-1$
}
}
this.setter = setter;
}