#107 Intercepting Filter example JavaDoc
This commit is contained in:
parent
665dc703d6
commit
0d8b3c9935
@ -2,13 +2,17 @@ package com.iluwatar.intercepting.filter;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* This is an app that checks whether the order request is valid through pre-processing done via Filters
|
* This is an app that checks whether the order request is valid through pre-processing done via {@link Filter}.
|
||||||
* Each field has its own corresponding Filter
|
* Each field has its own corresponding {@link Filter}
|
||||||
* @author joshzambales
|
* @author joshzambales
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class App{
|
public class App{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Program entry point
|
||||||
|
* @param args command line args
|
||||||
|
*/
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
FilterManager filterManager = new FilterManager(new Target());
|
FilterManager filterManager = new FilterManager(new Target());
|
||||||
filterManager.addFilter(new NameFilter());
|
filterManager.addFilter(new NameFilter());
|
||||||
|
@ -15,9 +15,9 @@ import javax.swing.JTextField;
|
|||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Client class is responsible for handling the input and running them through filters inside the filterManager
|
* The Client class is responsible for handling the input and running them through filters inside the {@link FilterManager}.
|
||||||
*
|
*
|
||||||
* This is where Filters come to play as the client pre-processes the request before being displayed in the Target
|
* This is where {@link Filter}s come to play as the client pre-processes the request before being displayed in the {@link Target}.
|
||||||
*
|
*
|
||||||
* @author joshzambales
|
* @author joshzambales
|
||||||
*
|
*
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.iluwatar.intercepting.filter;
|
package com.iluwatar.intercepting.filter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter interface Filters perform certain tasks prior or after execution of
|
* Filters perform certain tasks prior or after execution of
|
||||||
* request by request handler. In this case, before the request is handled by
|
* request by request handler. In this case, before the request is handled by
|
||||||
* the target, the request undergoes through each Filter
|
* the target, the request undergoes through each Filter
|
||||||
*
|
*
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.iluwatar.intercepting.filter;
|
package com.iluwatar.intercepting.filter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter Manager manages the filters and Filter Chain.
|
* Filter Manager manages the filters and {@link FilterChain}.
|
||||||
*
|
*
|
||||||
* @author joshzambales
|
* @author joshzambales
|
||||||
*
|
*
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.iluwatar.intercepting.filter;
|
package com.iluwatar.intercepting.filter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Concrete implementation of filter This filter checks if the input in the Name
|
* Concrete implementation of filter. This filter checks if the input in the Name
|
||||||
* field is valid. (alphanumeric)
|
* field is valid. (alphanumeric)
|
||||||
*
|
*
|
||||||
* @author joshzambales
|
* @author joshzambales
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.iluwatar.intercepting.filter;
|
package com.iluwatar.intercepting.filter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Concrete implementation of filter This checks for the order field
|
* Concrete implementation of filter. This checks for the order field.
|
||||||
*
|
*
|
||||||
* @author joshzambales
|
* @author joshzambales
|
||||||
*
|
*
|
||||||
|
@ -4,6 +4,11 @@ import org.junit.Test;
|
|||||||
|
|
||||||
import com.iluwatar.intercepting.filter.App;
|
import com.iluwatar.intercepting.filter.App;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Application test.
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class AppTest {
|
public class AppTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user