Commit 7e3cc3c2 authored by Raimbek Egemberdiev's avatar Raimbek Egemberdiev

component counter

parent 466d0b4e
package kz.arta.synergy.api.asforms.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* @author raimbek
* @since 09.11.2016
*/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Counter {
String value() default "";
}
...@@ -32,6 +32,7 @@ public class DefaultAsFormConverter implements AsFormConverter { ...@@ -32,6 +32,7 @@ public class DefaultAsFormConverter implements AsFormConverter {
registerConverter(Table.class, new TableConverter(this)); registerConverter(Table.class, new TableConverter(this));
registerConverter(DateCmp.class, new DateConverter()); registerConverter(DateCmp.class, new DateConverter());
registerConverter(Radio.class, new RadioConverter()); registerConverter(Radio.class, new RadioConverter());
registerConverter(Counter.class, new CounterConverter());
} }
@Override @Override
......
package kz.arta.synergy.api.asforms.converter.components;
import kz.arta.synergy.api.asforms.annotations.Counter;
import kz.arta.synergy.api.asforms.pojo.ComponentTypes;
import java.lang.annotation.Annotation;
/**
* @author raimbek
* @since 11.11.2016
*/
public class CounterConverter extends AbstractComponentConverter {
@Override
public String getType(Annotation annotation) {
return ComponentTypes.COUNTER;
}
@Override
public String getCmpId(Annotation annotation) {
return ((Counter) annotation).value();
}
}
...@@ -22,4 +22,5 @@ public class ComponentTypes { ...@@ -22,4 +22,5 @@ public class ComponentTypes {
public static final String FILE_LINK = "filelink"; public static final String FILE_LINK = "filelink";
public static final String REG_LINK = "reglink"; public static final String REG_LINK = "reglink";
public static final String CUSTOM = "custom"; public static final String CUSTOM = "custom";
public static final String COUNTER = "counter";
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment