Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Adding Guice] Still on that huge refactor
- Loading branch information
Showing
80 changed files
with
474 additions
and
491 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,35 @@ | ||
package br.com.caelum.tubaina.chunk; | ||
|
||
import br.com.caelum.tubaina.Chunk; | ||
import br.com.caelum.tubaina.parser.Parser; | ||
import br.com.caelum.tubaina.AbstractChunk; | ||
|
||
|
||
public class ImageChunk implements Chunk { | ||
public class ImageChunk extends AbstractChunk<ImageChunk> { | ||
|
||
private final String options; | ||
private final String path; | ||
private final double width; | ||
private final int dpi; | ||
|
||
public ImageChunk(String path, String options, double width, int dpi) { | ||
this.options = options; | ||
this.path = path; | ||
this.options = options; | ||
this.width = width; | ||
this.dpi = dpi; | ||
} | ||
|
||
@Override | ||
public String asString(Parser p) { | ||
return p.parseImage(this.path,this.options + " [" + width + "," + dpi + "]"); | ||
public String getOptions() { | ||
return options; | ||
} | ||
|
||
public String getPath() { | ||
return path; | ||
} | ||
|
||
public double getWidth() { | ||
return width; | ||
} | ||
|
||
public int getDpi() { | ||
return dpi; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
package br.com.caelum.tubaina.chunk; | ||
|
||
import br.com.caelum.tubaina.Chunk; | ||
import br.com.caelum.tubaina.parser.Parser; | ||
import br.com.caelum.tubaina.AbstractChunk; | ||
|
||
public class IndexChunk implements Chunk{ | ||
public class IndexChunk extends AbstractChunk<IndexChunk>{ | ||
|
||
private final String name; | ||
public IndexChunk(String name) { | ||
this.name = name; | ||
|
||
} | ||
public String asString(Parser p) { | ||
return p.parseIndex(name); | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
package br.com.caelum.tubaina.chunk; | ||
|
||
import br.com.caelum.tubaina.Chunk; | ||
import br.com.caelum.tubaina.parser.Parser; | ||
import br.com.caelum.tubaina.AbstractChunk; | ||
|
||
public class JavaChunk implements Chunk { | ||
public class JavaChunk extends AbstractChunk<JavaChunk> { | ||
|
||
private String content; | ||
|
||
private final String options; | ||
|
||
public JavaChunk(String options, String content) { | ||
this.content = content; | ||
this.options = options; | ||
} | ||
|
||
public String asString(Parser p) { | ||
return p.parseJava(content, options); | ||
public String getContent() { | ||
return content; | ||
} | ||
|
||
public String getOptions() { | ||
return options; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
package br.com.caelum.tubaina.chunk; | ||
|
||
import br.com.caelum.tubaina.Chunk; | ||
import br.com.caelum.tubaina.parser.Parser; | ||
import br.com.caelum.tubaina.AbstractChunk; | ||
|
||
public class MockedChunk implements Chunk { | ||
public class MockedChunk extends AbstractChunk<MockedChunk> { | ||
|
||
private String content; | ||
|
||
public MockedChunk(String content) { | ||
this.content = content; | ||
} | ||
|
||
public String asString(Parser p) { | ||
public String getContent() { | ||
return content; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 4 additions & 6 deletions
10
src/main/java/br/com/caelum/tubaina/chunk/ParagraphChunk.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
package br.com.caelum.tubaina.chunk; | ||
|
||
import br.com.caelum.tubaina.Chunk; | ||
import br.com.caelum.tubaina.parser.Parser; | ||
import br.com.caelum.tubaina.AbstractChunk; | ||
|
||
public class ParagraphChunk implements Chunk{ | ||
public class ParagraphChunk extends AbstractChunk<ParagraphChunk>{ | ||
|
||
private String content; | ||
|
||
public ParagraphChunk(String content) { | ||
this.content = content; | ||
} | ||
|
||
public String asString(Parser p) { | ||
return p.parseParagraph(this.content); | ||
public String getContent() { | ||
return content; | ||
} | ||
|
||
} |
12 changes: 5 additions & 7 deletions
12
src/main/java/br/com/caelum/tubaina/chunk/ParagraphInsideItemChunk.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
package br.com.caelum.tubaina.chunk; | ||
|
||
import br.com.caelum.tubaina.Chunk; | ||
import br.com.caelum.tubaina.parser.Parser; | ||
import br.com.caelum.tubaina.AbstractChunk; | ||
|
||
public class ParagraphInsideItemChunk implements Chunk { | ||
public class ParagraphInsideItemChunk extends AbstractChunk<ParagraphInsideItemChunk> { | ||
|
||
private final String content; | ||
|
||
public ParagraphInsideItemChunk(String content) { | ||
this.content = content; | ||
} | ||
|
||
public String asString(Parser p) { | ||
return p.parseParagraphInsideItem(content); | ||
} | ||
|
||
public String getContent() { | ||
return content; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.