# HG changeset patch # User Jaroslav Tulach # Date 1213430017 -7200 # Node ID ee4e8d38093ea90c1efc28ca09a5183c7d0cb7a0 # Parent aa07c59612ac8d2c8f56e0586c517e2b11ebb147 Finished review of "are abstract classes useful?", up to line 1600 diff -r aa07c59612ac -r ee4e8d38093e samples/forjoe/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/samples/forjoe/build.xml Sat Jun 14 09:53:37 2008 +0200 @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r aa07c59612ac -r ee4e8d38093e samples/forjoe/nbproject/project.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/samples/forjoe/nbproject/project.xml Sat Jun 14 09:53:37 2008 +0200 @@ -0,0 +1,81 @@ + + + org.netbeans.modules.ant.freeform + + + forjoe + + + + forjoe + + + + + . + UTF-8 + + + + java + src-api1.0 + UTF-8 + + + + java + src-impl + UTF-8 + + + + + build + + + clean + + + run + + + clean + build + + + + + + + src-api1.0 + + + + src-impl + + + build.xml + + + + + + + + + + + + + + src-api1.0 + 1.5 + + + src-impl + src-api1.0 + 1.5 + + + + diff -r aa07c59612ac -r ee4e8d38093e samples/forjoe/src-api1.0/api/InterfaceThatJustJoeCanImplement.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/samples/forjoe/src-api1.0/api/InterfaceThatJustJoeCanImplement.java Sat Jun 14 09:53:37 2008 +0200 @@ -0,0 +1,13 @@ +package api; + +// BEGIN: forjoe.InterfaceThatJustJoeCanImplement +public abstract class InterfaceThatJustJoeCanImplement { + protected InterfaceThatJustJoeCanImplement() { + if (!"impl.joe.JoesImpl".equals(getClass().getName())) { + throw new IllegalStateException("Sorry, you are not allowed to implement this class"); + } + } + + public abstract void everyoneCallThisJoeWillHandleTheRequest(); +} +// END: forjoe.InterfaceThatJustJoeCanImplement diff -r aa07c59612ac -r ee4e8d38093e samples/forjoe/src-impl/impl/joe/JoesImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/samples/forjoe/src-impl/impl/joe/JoesImpl.java Sat Jun 14 09:53:37 2008 +0200 @@ -0,0 +1,9 @@ +package impl.joe; + +import api.InterfaceThatJustJoeCanImplement; + +public class JoesImpl extends InterfaceThatJustJoeCanImplement { + @Override + public void everyoneCallThisJoeWillHandleTheRequest() { + } +} diff -r aa07c59612ac -r ee4e8d38093e samples/forjoe/src-impl/impl/joe/Main.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/samples/forjoe/src-impl/impl/joe/Main.java Sat Jun 14 09:53:37 2008 +0200 @@ -0,0 +1,12 @@ + +package impl.joe; + +import api.InterfaceThatJustJoeCanImplement; + +public class Main { + public static void main(String[] args) throws Exception { + InterfaceThatJustJoeCanImplement i = new JoesImpl(); + + i.everyoneCallThisJoeWillHandleTheRequest(); + } +}