package org.jboss.forge.addon.javaee.validation.ui;

import javax.validation.Payload;

import org.jboss.forge.addon.javaee.validation.ValidationFacet;
import org.jboss.forge.addon.projects.Project;
import org.jboss.forge.addon.projects.stacks.annotations.StackConstraint;
import org.jboss.forge.addon.ui.context.UIContext;
import org.jboss.forge.addon.ui.context.UIExecutionContext;
import org.jboss.forge.addon.ui.util.Metadata;
import org.jboss.forge.roaster.model.source.JavaClassSource;

/**
 * @author <a href="antonio.goncalves@gmail.com">Antonio Goncalves</a>
 */
@StackConstraint(ValidationFacet.class)
public class ValidationNewPayloadCommandImpl extends AbstractValidationCommand<JavaClassSource>
         implements ValidationNewPayloadCommand
{
   @Override
   public Metadata getMetadata(UIContext context)
   {
      return Metadata.from(super.getMetadata(context), getClass())
               .name("Constraint: New Payload")
               .description("Create a Bean Validation payload");
   }

   @Override
   protected String getType()
   {
      return "Constraint Payload";
   }

   @Override
   protected Class<JavaClassSource> getSourceType()
   {
      return JavaClassSource.class;
   }

   @Override
   public JavaClassSource decorateSource(UIExecutionContext context, Project project, JavaClassSource source)
            throws Exception
   {
      source.addInterface(Payload.class);
      return source;
   }
}

@@ -1200,24 +1200,199 @@
 class;%0A   %7D%0A
+   %0A   @Override%0A   protected boolean supportsExtends()%0A   %7B%0A      return false;%0A   %7D%0A%0A   @Override%0A   protected boolean supportsImplements()%0A   %7B%0A      return false;%0A   %7D%0A   
 %0A   @Overrid

Update ValidationNewPayloadCommandImpl.java