com.google.gwt.i18n.rebind.KeyGenMessageInterface Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vaadin-client Show documentation
Show all versions of vaadin-client Show documentation
Vaadin is a web application framework for Rich Internet Applications (RIA).
Vaadin enables easy development and maintenance of fast and
secure rich web
applications with a stunning look and feel and a wide browser support.
It features a server-side architecture with the majority of the logic
running
on the server. Ajax technology is used at the browser-side to ensure a
rich
and interactive user experience.
/*
* Copyright 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.gwt.i18n.rebind;
import com.google.gwt.core.ext.typeinfo.JClassType;
import com.google.gwt.i18n.server.MessageInterface;
import com.google.gwt.i18n.server.MessageInterfaceVisitor;
import com.google.gwt.i18n.server.MessageProcessingException;
import com.google.gwt.i18n.shared.GwtLocale;
import java.lang.annotation.Annotation;
/**
* Simple {@link MessageInterface} implementation only suitable for use with
* {@link com.google.gwt.i18n.server.KeyGenerator KeyGenerator}.
*/
class KeyGenMessageInterface implements MessageInterface {
private JClassType type;
/**
* @param type
*/
public KeyGenMessageInterface(JClassType type) {
this.type = type;
}
public void accept(MessageInterfaceVisitor cv)
throws MessageProcessingException {
throw new MessageProcessingException("unsupported");
}
public void accept(MessageInterfaceVisitor cv, GwtLocale locale)
throws MessageProcessingException {
throw new MessageProcessingException("unsupported");
}
public A getAnnotation(Class annotClass) {
return type.findAnnotationInTypeHierarchy(annotClass);
}
public String getClassName() {
return type.getName();
}
public String getPackageName() {
return type.getPackage().getName();
}
public String getQualifiedName() {
return type.getQualifiedSourceName();
}
public boolean isAnnotationPresent(Class extends Annotation> annotClass) {
return type.findAnnotationInTypeHierarchy(annotClass) != null;
}
}