You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ConnectorInitVisitor.java 1000B

1234567891011121314151617181920212223242526272829
  1. /*
  2. @VaadinApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.server.widgetsetutils.metadata;
  5. import com.google.gwt.core.ext.TreeLogger;
  6. import com.google.gwt.core.ext.TreeLogger.Type;
  7. import com.google.gwt.core.ext.UnableToCompleteException;
  8. import com.google.gwt.core.ext.typeinfo.JClassType;
  9. import com.vaadin.shared.ui.Connect;
  10. public class ConnectorInitVisitor extends TypeVisitor {
  11. @Override
  12. public void visitConnector(TreeLogger logger, JClassType type,
  13. ConnectorBundle bundle) throws UnableToCompleteException {
  14. Connect connectAnnotation = type.getAnnotation(Connect.class);
  15. if (connectAnnotation != null) {
  16. logger.log(Type.INFO, type.getName() + " will be in the "
  17. + bundle.getName().replaceAll("^_*", "") + " bundle");
  18. String identifier = connectAnnotation.value().getCanonicalName();
  19. bundle.setIdentifier(type, identifier);
  20. bundle.setNeedsGwtConstructor(type);
  21. }
  22. }
  23. }