package org.auraframework.impl.root.parser.handler;

import java.io.IOException;

import javax.xml.stream.XMLStreamException;

import org.auraframework.def.AttributeDesignDef;
import org.auraframework.def.DesignDef;
import org.auraframework.throwable.quickfix.QuickFixException;

public class AttributeDesignDefHandler extends ParentedTagHandler<AttributeDesignDef, DesignDef> {
    public static final String TAG = "aura:designattribute";
    
    @Override
    protected void handleChildTag() throws XMLStreamException, QuickFixException {
        // TODO Auto-generated method stub
        
    }

    @Override
    protected void handleChildText() throws XMLStreamException, QuickFixException {
        // TODO Auto-generated method stub
        
    }

    @Override
    public String getHandledTag() {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    protected AttributeDesignDef createDefinition() throws QuickFixException {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public void writeElement(AttributeDesignDef def, Appendable out) throws IOException {
        // TODO Auto-generated method stub
        
    }

}

@@ -65,32 +65,54 @@
 .io.IOException;
+%0Aimport java.util.Set;
 %0A%0Aimport javax.x
@@ -293,16 +293,108 @@
 ception;
+%0Aimport org.auraframework.util.AuraTextUtil;%0A%0Aimport com.google.common.collect.ImmutableSet;
 %0A%0Apublic
@@ -560,143 +560,2135 @@
     
-@Override%0A    protected void handleChildTag() throws XMLStreamException, QuickFixException %7B%0A        // TODO Auto-generated method stub
+private static final String ATTRIBUTE_NAME = %22name%22;%0A    private static final String ATTRIBUTE_TYPE = %22type%22;%0A    private static final String ATTRIBUTE_REQUIRED = %22required%22;%0A    private static final String ATTRIBUTE_READONLY = %22readonly%22;%0A    private static final String ATTRIBUTE_DEPENDENCY = %22dependsOn%22;%0A    private static final String ATTRIBUTE_DATASOURCE = %22dataSource%22;%0A    private static final String ATTRIBUTE_MIN = %22min%22;%0A    private static final String ATTRIBUTE_MAX = %22max%22;%0A    %0A    private final static Set%3CString%3E ALLOWED_ATTRIBUTES = ImmutableSet.of(ATTRIBUTE_NAME, ATTRIBUTE_TYPE, ATTRIBUTE_REQUIRED, %0A            ATTRIBUTE_READONLY, ATTRIBUTE_DEPENDENCY, ATTRIBUTE_DATASOURCE, ATTRIBUTE_MIN, ATTRIBUTE_MAX);%0A    %0A    //TODO implement tool specific properties%0A    %0A    @Override%0A    protected void readAttributes() throws QuickFixException %7B%0A        super.readAttributes();%0A        %0A        String name = getAttributeValue(ATTRIBUTE_NAME);%0A        String type = getAttributeValue(ATTRIBUTE_TYPE);%0A        String required = getAttributeValue(ATTRIBUTE_REQUIRED);%0A        String readonly = getAttributeValue(ATTRIBUTE_READONLY);%0A        String dependency = getAttributeValue(ATTRIBUTE_DEPENDENCY);%0A        String datasource = getAttributeValue(ATTRIBUTE_DATASOURCE);%0A        String min = getAttributeValue(ATTRIBUTE_MIN);%0A        String max = getAttributeValue(ATTRIBUTE_MAX);%0A        %0A        if (!AuraTextUtil.isNullEmptyOrWhitespace(name)) %7B%0A            %0A        %7D%0A        %0A        if (!AuraTextUtil.isNullEmptyOrWhitespace(type)) %7B%0A            %0A        %7D%0A        %0A        if (!AuraTextUtil.isNullEmptyOrWhitespace(required)) %7B%0A            %0A        %7D%0A        %0A        if (!AuraTextUtil.isNullEmptyOrWhitespace(readonly)) %7B%0A            %0A        %7D%0A        %0A        if (!AuraTextUtil.isNullEmptyOrWhitespace(dependency)) %7B%0A            %0A        %7D%0A        %0A        if (!AuraTextUtil.isNullEmptyOrWhitespace(datasource)) %7B%0A            %0A        %7D%0A        %0A        if (!AuraTextUtil.isNullEmptyOrWhitespace(min)) %7B%0A            %0A        %7D%0A        %0A        if (!AuraTextUtil.isNullEmptyOrWhitespace(max)) %7B%0A            
 %0A   
@@ -2684,39 +2684,44 @@
        %0A        
+%7D
 %0A    %7D%0A
+    
 %0A    @Override%0A 
@@ -2750,19 +2750,18 @@
 leChildT
-ext
+ag
 () throw
@@ -2814,51 +2814,233 @@
     
-// TODO Auto-generated method stub%0A        
+error(%22Found unexpected tag %25s%22, getTagName());%0A    %7D%0A%0A    @Override%0A    protected void handleChildText() throws XMLStreamException, QuickFixException %7B%0A        error(%22No literal text allowed in attribute design definition%22);
 %0A   
@@ -3072,75 +3072,135 @@
 lic 
+Set%3C
 String
+%3E
  get
-HandledTag() %7B%0A        // TODO Auto-generated method stub
+AllowedAttributes() %7B%0A        return ALLOWED_ATTRIBUTES;%0A    %7D%0A    @Override%0A    public String getHandledTag() %7B
 %0A   
@@ -3203,36 +3203,35 @@
 %0A        return 
-null
+TAG
 ;%0A    %7D%0A%0A    @Ov

read allowed attributes for attribute design def