Skip to content

Commit

Permalink
Merge pull request #17 from izumin5210/combined-store
Browse files Browse the repository at this point in the history
New API
  • Loading branch information
Masayuki IZUMI committed Nov 29, 2015
2 parents fcaeba5 + cdaf7b3 commit 1dd9471
Show file tree
Hide file tree
Showing 64 changed files with 1,534 additions and 1,375 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class DroiduxProcessor extends BasicAnnotationProcessor {
protected Iterable<? extends ProcessingStep> initSteps() {
return ImmutableList.<ProcessingStep>of(
new ReducerProcessingStep(getFiler()),
new CombinedReducerProcessingStep(getFiler())
new StoreProcessingStep(getFiler())
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@

import javax.annotation.processing.Filer;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;

import info.izumin.android.droidux.annotation.Reducer;
import info.izumin.android.droidux.processor.generator.StoreClassGenerator;
import info.izumin.android.droidux.processor.model.ReducerModel;

/**
* Created by izumin on 11/26/15.
Expand All @@ -32,9 +29,9 @@ public Set<? extends Class<? extends Annotation>> annotations() {

@Override
public Set<Element> process(SetMultimap<Class<? extends Annotation>, Element> elementsByAnnotation) {
for (Element element : elementsByAnnotation.get(Reducer.class)) {
write(new StoreClassGenerator(new ReducerModel((TypeElement) element)).createJavaFile());
}
// for (Element element : elementsByAnnotation.get(Reducer.class)) {
// write(new StoreImplClassGenerator(new ReducerModel((TypeElement) element)).createJavaFile());
// }
return new HashSet<>();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package info.izumin.android.droidux.processor;

import com.google.common.collect.ImmutableSet;
import com.google.common.collect.SetMultimap;

import java.lang.annotation.Annotation;
import java.util.HashSet;
import java.util.Set;

import javax.annotation.processing.Filer;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;

import info.izumin.android.droidux.annotation.Store;
import info.izumin.android.droidux.processor.generator.StoreClassGenerator;
import info.izumin.android.droidux.processor.generator.StoreImplClassGenerator;
import info.izumin.android.droidux.processor.model.StoreImplModel;
import info.izumin.android.droidux.processor.model.StoreModel;

/**
* Created by izumin on 11/26/15.
*/
public class StoreProcessingStep extends AbstractProcessingStep {
public static final String TAG = StoreProcessingStep.class.getSimpleName();

public StoreProcessingStep(Filer filer) {
super(filer);
}

@Override
public Set<? extends Class<? extends Annotation>> annotations() {
return ImmutableSet.<Class<? extends Annotation>>of(Store.class);
}

@Override
public Set<Element> process(SetMultimap<Class<? extends Annotation>, Element> elementsByAnnotation) {
for (Element element : elementsByAnnotation.get(Store.class)) {
StoreModel model = new StoreModel((TypeElement) element);
for (StoreImplModel storeImplModel : model.getStoreImplModels()) {
write(new StoreImplClassGenerator(storeImplModel).createJavaFile());
}
write(new StoreClassGenerator(model).createJavaFile());
}
return new HashSet<>();
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package info.izumin.android.droidux.processor.exception;

/**
* Created by izumin on 11/7/15.
*/
public class InvalidDispatchableDeclarationException extends RuntimeException {
public InvalidDispatchableDeclarationException(String message) {
super(message);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package info.izumin.android.droidux.processor.exception;

/**
* Created by izumin on 11/8/15.
*/
public class InvalidReducerDeclarationException extends RuntimeException {
public InvalidReducerDeclarationException(String message) {
super(message);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package info.izumin.android.droidux.processor.exception;

/**
* Created by izumin on 11/24/15.
*/
public class InvalidStoreDelcarationException extends RuntimeException {
public InvalidStoreDelcarationException(String message) {
super(message);
}
}

This file was deleted.

Loading

0 comments on commit 1dd9471

Please sign in to comment.