Skip to content

Commit beed066

Browse files
committed
Additional documentation and minor refactoring.
1 parent cb0caf3 commit beed066

30 files changed

Lines changed: 146 additions & 55 deletions
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,90 @@
1+
/*
2+
* Copyright 2013 <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package org.ocpsoft.urlbuilder;
217

18+
/**
19+
* Represents a valid web address, or valid web address fragment.
20+
*
21+
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
22+
*/
323
public interface Address
424
{
25+
/**
26+
* Return the anchor '#' section of the {@link Address}, or <code>null</code> if no anchor is set.
27+
*/
528
String getAnchor();
629

30+
/**
31+
* Return <code>true</code> if the {@link Address} contains an anchor '#' section, otherwise return
32+
* <code>false</code>.
33+
*/
734
boolean isAnchorSet();
835

36+
/**
37+
* Get the path section of this {@link Address}, or <code>null</code> if no path is set.
38+
*/
939
String getPath();
1040

41+
/**
42+
* Get the path and query sections of this {@link Address}, or <code>null</code> if neither are set.
43+
*/
1144
String getPathAndQuery();
1245

46+
/**
47+
* Return <code>true</code> if this {@link Address} contains a path section, otherwise return <code>false</code>.
48+
*/
1349
boolean isPathSet();
1450

51+
/**
52+
* Get the port of this {@link Address}, or <code>null</code> if no port is set.
53+
*/
1554
Integer getPort();
1655

56+
/**
57+
* Return <code>true</code> if a port is set in {@link Address}, otherwise return <code>false</code>.
58+
*/
1759
boolean isPortSet();
1860

61+
/**
62+
* Get the domain section of this {@link Address}, or <code>null</code> if no domain is set.
63+
*/
1964
String getHost();
2065

66+
/**
67+
* Return <code>true</code> if this {@link Address} has a host section, otherwise return <code>false</code>.
68+
*/
2169
boolean isHostSet();
2270

71+
/**
72+
* Get the protocol section of this {@link Address}, or null if no protocol is set.
73+
*/
2374
String getProtocol();
2475

76+
/**
77+
* Return <code>true</code> if this {@link Address} has a protocol section, otherwise return <code>false</code>.
78+
*/
2579
boolean isProtocolSet();
2680

81+
/**
82+
* Get the query section of this {@link Address}, or <code>null</code> if no query is set.
83+
*/
2784
String getQuery();
2885

86+
/**
87+
* Return <code>true</code> if this {@link Address} contains a query section, otherwise return <code>false</code>.
88+
*/
2989
boolean isQuerySet();
3090
}

‎api-servlet/src/main/java/org/ocpsoft/rewrite/servlet/config/HttpConfigurationCacheProvider.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import javax.servlet.ServletContext;
44

5-
import org.ocpsoft.rewrite.config.ConfigurationCacheProvider;
5+
import org.ocpsoft.rewrite.spi.ConfigurationCacheProvider;
66

77
/**
88
* Configuration cache provider for HTTP/Servlet environments.

‎api-tests/src/test/java/org/ocpsoft/rewrite/config/ConfigurationCacheProviderTest.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.junit.Assert;
2222
import org.junit.Test;
2323
import org.ocpsoft.rewrite.Root;
24+
import org.ocpsoft.rewrite.spi.ConfigurationCacheProvider;
2425
import org.ocpsoft.rewrite.test.HttpAction;
2526
import org.ocpsoft.rewrite.test.RewriteTest;
2627
import org.ocpsoft.rewrite.util.Timer;

‎api/src/main/java/org/ocpsoft/rewrite/bind/Bindable.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2011 <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
2+
* Copyright 2013 <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

‎api/src/main/java/org/ocpsoft/rewrite/config/And.java‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424
import org.ocpsoft.rewrite.event.Rewrite;
2525

2626
/**
27-
* Evaluates all provided conditions. If all provided conditions return true, this condition returns true. If any
28-
* provided conditions return false, this condition returns false.
27+
* Evaluates all provided {@link Condition} instances. If all provided conditions return <code>true</code>, this
28+
* condition returns <code>true</code>. If any provided conditions return <code>false</code>, this condition returns
29+
* <code>false</code>.
2930
*
3031
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
3132
*/
@@ -39,8 +40,9 @@ private And(final Condition... conditions)
3940
}
4041

4142
/**
42-
* Creates a new {@link And} condition. If all provided conditions return true, this condition returns true. If any
43-
* provided conditions return false, this condition returns false.
43+
* Creates a new {@link And} condition. If all provided {@link Condition} instances return <code>true</code>, this
44+
* condition returns <code>true</code>. If any provided conditions return <code>false</code>, this condition returns
45+
* <code>false</code>.
4446
*
4547
* @param conditions the array of conditions to be evaluated
4648
*/

‎api/src/main/java/org/ocpsoft/rewrite/config/Conditions.java‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2011 <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package org.ocpsoft.rewrite.config;
217

318
import org.ocpsoft.rewrite.context.EvaluationContext;

‎api/src/main/java/org/ocpsoft/rewrite/config/Configuration.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717

1818
import java.util.List;
1919

20+
import org.ocpsoft.rewrite.event.Rewrite;
21+
2022
/**
21-
* Base interface for all Rewrite configuration objects.
23+
* Configuration for the {@link Rewrite} framework.
2224
*
2325
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
2426
*/

‎api/src/main/java/org/ocpsoft/rewrite/config/ConfigurationBuilder.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static ConfigurationBuilder begin()
5151
}
5252

5353
/**
54-
* Define a new fluent {@link Rule}
54+
* Add a new fluent {@link Rule}.
5555
*/
5656
@Override
5757
public ConfigurationRuleBuilderCustom addRule()
@@ -62,7 +62,7 @@ public ConfigurationRuleBuilderCustom addRule()
6262
}
6363

6464
/**
65-
* Add a pre-defined {@link Rule}.
65+
* Add a {@link Rule}.
6666
*/
6767
@Override
6868
public ConfigurationRuleBuilder addRule(final Rule rule)

‎api/src/main/java/org/ocpsoft/rewrite/config/ConfigurationBuilderRoot.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
public interface ConfigurationBuilderRoot extends Configuration
2222
{
2323
/**
24-
* Define a new fluent {@link Rule}
24+
* Define a new fluent {@link Rule}.
2525
*/
2626
public ConfigurationRuleBuilderCustom addRule();
2727

2828
/**
29-
* Add a pre-defined {@link Rule}
29+
* Add a pre-defined {@link Rule}.
3030
*/
3131
public ConfigurationRuleBuilder addRule(final Rule rule);
3232
}

‎api/src/main/java/org/ocpsoft/rewrite/config/ConfigurationLoader.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.ocpsoft.rewrite.param.DefaultParameter;
3232
import org.ocpsoft.rewrite.param.ParameterStore;
3333
import org.ocpsoft.rewrite.param.Parameterized;
34+
import org.ocpsoft.rewrite.spi.ConfigurationCacheProvider;
3435
import org.ocpsoft.rewrite.util.Visitor;
3536

3637
/**

0 commit comments

Comments
 (0)