Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New API #17

Merged
merged 23 commits into from
Nov 29, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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