abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r468558 - /incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/
Date Fri, 27 Oct 2006 22:11:42 GMT
Author: jmsnell
Date: Fri Oct 27 15:11:42 2006
New Revision: 468558

URL: http://svn.apache.org/viewvc?view=rev&rev=468558
Log:
Javadoc improvements

Modified:
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaConfiguration.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaDataSource.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractNamedParser.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractNamedWriter.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParser.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractXPath.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/MimeTypeHelper.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/ServiceUtil.java
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/URIHelper.java

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaConfiguration.java?view=diff&rev=468558&r1=468557&r2=468558
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaConfiguration.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaConfiguration.java
Fri Oct 27 15:11:42 2006
@@ -28,9 +28,16 @@
 import org.apache.abdera.parser.NamedParser;
 import org.apache.abdera.writer.NamedWriter;
 
+/**
+ * Provides the basic configuration for the Abdera default implementation.
+ */
 public final class AbderaConfiguration 
   implements Constants, Cloneable {
   
+  /**
+   * Returns the default configuration. Every call to this method returns
+   * a new AbderaConfiguration instance using abdera.properties
+   */
   public static synchronized AbderaConfiguration getDefault() {
     AbderaConfiguration instance = null;
     try {
@@ -93,6 +100,10 @@
     return bundle;
   }
 
+  /**
+   * Retrieve the value of the specified configuration option
+   * @returns The configuration option value or null
+   */
   public String getConfigurationOption(String id) {
     String option = System.getProperty(id);
     if (option == null) {
@@ -106,50 +117,86 @@
     return option;
   }
   
+  /**
+   * Retrieve the value of the specified configuration option or _default
+   * if the value is null
+   * @returns The configuration option value of _default
+   */
   public String getConfigurationOption(String id, String _default) {
     String value = getConfigurationOption(id);
     return (value != null) ? value : _default;
   }
   
+  /**
+   * Returns the Java classname of the default Abdera XPath implementation
+   */
   public String getDefaultXPath() {
     return xpath;
   }
   
+  /**
+   * Returns the Java classname of the default Abdera Parser implementation
+   */
   public String getDefaultParser() {
     return parser;
   }
   
+  /**
+   * Returns the Java classname of the default Abdera Factory implementation
+   */
   public String getDefaultFactory() {
     return factory;
   }
   
+  /**
+   * Returns the Java classname of the default ParserFactory implementation
+   */
   public String getDefaultParserFactory() {
     return parserFactory; 
   }
   
+  /**
+   * Returns the Java classname of the default WriterFactory implementation
+   */
   public String getDefaultWriterFactory() {
     return writerFactory;
   }
   
+  /**
+   * Returns the Java classname of the default Writer implementation
+   */
   public String getDefaultWriter() {
     return writer;
   }
   
+  /**
+   * Registers an ExtensionFactory implementation.
+   */
   public void addExtensionFactory(ExtensionFactory factory) {
     List<ExtensionFactory> factories = getExtensionFactories();
     if (!factories.contains(factory))
       factories.add(factory);
   }
   
+  /**
+   * Returns the listing of registered ExtensionFactory implementations
+   */
   public List<ExtensionFactory> getExtensionFactories() {
     return factories;
   }
   
+  /**
+   * Registers a NamedWriter implementation
+   */
   public void addNamedWriter(NamedWriter writer) {
     Map<String,NamedWriter> writers = getNamedWriters();
     writers.put(writer.getName(), writer);
   }
   
+  /**
+   * Registers NamedWriter implementations using 
+   * the /META-INF/services/org.apache.abdera.writer.NamedWriter file
+   */
   private Map<String,NamedWriter> initNamedWriters() {
     Map<String,NamedWriter> writers = null;
     List<NamedWriter> _writers = 
@@ -161,15 +208,25 @@
     return writers;
   }
   
+  /**
+   * Returns the collection of NamedWriters
+   */
   public Map<String,NamedWriter> getNamedWriters() {
     return writers;
   }
   
+  /**
+   * Registers a NamedParser implementation
+   */
   public void addNamedParser(NamedParser parser) {
     Map<String,NamedParser> parsers = getNamedParsers();
     parsers.put(parser.getName(), parser);
   }
   
+  /**
+   * Registers NamedParser implementations using 
+   * the /META-INF/services/org.apache.abdera.writer.NamedParser file 
+   */
   private Map<String,NamedParser> initNamedParsers() {
     Map<String,NamedParser> parsers = null;
     List<NamedParser> _parsers = 
@@ -181,6 +238,9 @@
     return parsers;
   }
   
+  /**
+   * Returns the collection of Named Parsers
+   */
   public Map<String,NamedParser> getNamedParsers() {
     return parsers;
   }

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaDataSource.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaDataSource.java?view=diff&rev=468558&r1=468557&r2=468558
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaDataSource.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbderaDataSource.java
Fri Oct 27 15:11:42 2006
@@ -27,6 +27,9 @@
 
 import org.apache.abdera.model.Base;
 
+/**
+ * Utility implementation of javax.activation.DataSource that wraps Abdera Base
+ */
 public class AbderaDataSource 
   implements DataSource {
 

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractNamedParser.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractNamedParser.java?view=diff&rev=468558&r1=468557&r2=468558
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractNamedParser.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractNamedParser.java
Fri Oct 27 15:11:42 2006
@@ -19,6 +19,9 @@
 
 import org.apache.abdera.parser.NamedParser;
 
+/**
+ * Base abstract implementation of NamedParser
+ */
 public abstract class AbstractNamedParser 
   extends AbstractParser 
   implements NamedParser {

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractNamedWriter.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractNamedWriter.java?view=diff&rev=468558&r1=468557&r2=468558
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractNamedWriter.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractNamedWriter.java
Fri Oct 27 15:11:42 2006
@@ -19,6 +19,9 @@
 
 import org.apache.abdera.writer.NamedWriter;
 
+/**
+ * Base abstract implementation of NamedWriter
+ */
 public abstract class AbstractNamedWriter 
   implements NamedWriter {
 

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParser.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParser.java?view=diff&rev=468558&r1=468557&r2=468558
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParser.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParser.java
Fri Oct 27 15:11:42 2006
@@ -29,6 +29,9 @@
 import org.apache.abdera.parser.ParserOptions;
 import org.apache.abdera.util.iri.IRISyntaxException;
 
+/**
+ * Abstract base implementation of Abdera Parser.
+ */
 public abstract class AbstractParser 
   implements Parser {
 

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractXPath.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractXPath.java?view=diff&rev=468558&r1=468557&r2=468558
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractXPath.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractXPath.java
Fri Oct 27 15:11:42 2006
@@ -25,6 +25,9 @@
 import org.apache.abdera.xpath.XPath;
 import org.apache.abdera.xpath.XPathException;
 
+/**
+ * Abstract base implementation of XPath
+ */
 public abstract class AbstractXPath 
   implements XPath {
   

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/MimeTypeHelper.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/MimeTypeHelper.java?view=diff&rev=468558&r1=468557&r2=468558
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/MimeTypeHelper.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/MimeTypeHelper.java
Fri Oct 27 15:11:42 2006
@@ -33,6 +33,9 @@
 import org.apache.abdera.model.Feed;
 import org.apache.abdera.model.Service;
 
+/**
+ * Utilities for working with MIME Media Types
+ */
 public class MimeTypeHelper {
    
   private static final MimeType WILDCARD = createWildcard();
@@ -45,6 +48,9 @@
     }
   }
   
+  /**
+   * Returns true if media type a matches media type b
+   */
   public static boolean isMatch(String a, String b) {
     if ((a == null || a.length() == 0) && 
         (b == null || b.length() == 0)) 
@@ -58,6 +64,9 @@
     return answer;
   }
   
+  /**
+   * Returns true if media type a matches media type b
+   */
   public static boolean isMatch(MimeType a, MimeType b) {
     try {
       if (a == null || b == null) return true;
@@ -75,14 +84,24 @@
     return false;
   }
   
+  /**
+   * Returns true if media type a matches application/atomsrv+xml
+   */
   public static boolean isApp(String a) {
     return isMatch(Constants.APP_MEDIA_TYPE, a);
   }
   
+  /**
+   * Returns true if media type a matches application/atom+xml
+   */
   public static boolean isAtom(String a) {
     return isMatch(Constants.ATOM_MEDIA_TYPE, a);
   }
   
+  /**
+   * Returns true if media type a matches application/xml, text/xml or 
+   * application/*+xml 
+   */
   public static boolean isXml(String a) {
     boolean answer = isMatch(Constants.XML_MEDIA_TYPE, a) || isMatch("text/xml", a);
     if (!answer) {
@@ -98,11 +117,17 @@
     return answer;
   }
   
+  /**
+   * Returns true if media type a matches text/*
+   */
   public static boolean isText(String a) {
     boolean answer = isMatch("text/*", a);
     return answer;
   }
   
+  /**
+   * Returns true if this is a valid media type
+   */
   public static boolean isMimeType(String a) {
     boolean answer = false;
     try {
@@ -114,6 +139,9 @@
     return answer;
   }
   
+  /**
+   * Returns the appropriate media type for the given Abdera base
+   */
   public static <T extends Base>String getMimeType(T base) {
     String type = null;
     if (base instanceof Document) {
@@ -176,6 +204,11 @@
     return false;
   }
   
+  /**
+   * Returns a Comparator that can be used to compare and sort MIME media types
+   * according to their level of specificity (e.g. text/* is less specific than
+   * text/plain and would appear first in a sorted list)
+   */
   public static Comparator<String> getComparator() {
     return new Comparator<String>() {
       public int compare(String o1, String o2) {
@@ -184,6 +217,9 @@
     };
   }
   
+  /**
+   * Compare two media types according to their relative level of specificity
+   */
   public static int compare(MimeType mt1, MimeType mt2) {
     String st1 = mt1.getSubType();
     String st2 = mt2.getSubType();
@@ -194,6 +230,9 @@
     return 0;
   }
   
+  /**
+   * Compare two media types according to their relative level of specificity
+   */
   public static int compare(String t1, String t2) {
     try {
       MimeType mt1 = new MimeType(t1);

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/ServiceUtil.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/ServiceUtil.java?view=diff&rev=468558&r1=468557&r2=468558
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/ServiceUtil.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/ServiceUtil.java
Fri Oct 27 15:11:42 2006
@@ -37,6 +37,9 @@
 import org.apache.abdera.writer.WriterFactory;
 import org.apache.abdera.xpath.XPath;
 
+/**
+ * Core utility methods that support Abdera's internal operation
+ */
 public final class ServiceUtil 
   implements Constants {
   

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/URIHelper.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/URIHelper.java?view=diff&rev=468558&r1=468557&r2=468558
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/URIHelper.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/URIHelper.java Fri
Oct 27 15:11:42 2006
@@ -22,6 +22,9 @@
 import org.apache.abdera.util.iri.IRI;
 import org.apache.abdera.util.iri.IRISyntaxException;
 
+/**
+ * Utility methods for working with URI's / IRI's
+ */
 public class URIHelper {
 
   private static final Pattern javascript = 



Mime
View raw message