You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mb...@apache.org on 2007/12/14 22:31:21 UTC
svn commit: r604304 - in
/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath: ./
ri/compiler/ ri/model/ ri/model/beans/ ri/model/dom/ ri/model/dynamic/
ri/model/jdom/ servlet/ util/
Author: mbenson
Date: Fri Dec 14 13:31:19 2007
New Revision: 604304
URL: http://svn.apache.org/viewvc?rev=604304&view=rev
Log:
checkstyle
Added:
commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/package.html (with props)
Modified:
commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathNotFoundException.java
commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreFunction.java
commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationAdd.java
commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationEqual.java
commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationLessThan.java
commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/NodePointerFactory.java
commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/BeanPropertyPointer.java
commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/CollectionPointer.java
commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/LangAttributePointer.java
commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/PropertyPointer.java
commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dom/NamespacePointer.java
commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicPointerFactory.java
commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicPropertyIterator.java
commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/jdom/JDOMAttributePointer.java
commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/HttpSessionAndServletContext.java
Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathNotFoundException.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathNotFoundException.java?rev=604304&r1=604303&r2=604304&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathNotFoundException.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/JXPathNotFoundException.java Fri Dec 14 13:31:19 2007
@@ -22,11 +22,14 @@
* @author Dmitri Plotnikov
* @version $Revision: 155422 $ $Date: 2005-02-26 08:07:46 -0500 (Sat, 26 Feb 2005) $
*/
-
public class JXPathNotFoundException extends JXPathException {
private static final long serialVersionUID = -8875537628056117241L;
+ /**
+ * Create a new JXPathNotFoundException.
+ * @param message exception detail
+ */
public JXPathNotFoundException(String message) {
super(message);
}
Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreFunction.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreFunction.java?rev=604304&r1=604303&r2=604304&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreFunction.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreFunction.java Fri Dec 14 13:31:19 2007
@@ -45,15 +45,28 @@
private static final Double ZERO = new Double(0);
private int functionCode;
+ /**
+ * Create a new CoreFunction.
+ * @param functionCode int function code
+ * @param args argument Expressions
+ */
public CoreFunction(int functionCode, Expression args[]) {
super(args);
this.functionCode = functionCode;
}
+ /**
+ * Get the function code.
+ * @return int function code
+ */
public int getFunctionCode() {
return functionCode;
}
-
+
+ /**
+ * Get the name of this function.
+ * @return String function name
+ */
protected String getFunctionName() {
switch (functionCode) {
case Compiler.FUNCTION_LAST :
@@ -118,18 +131,34 @@
return "unknownFunction" + functionCode + "()";
}
+ /**
+ * Convenience method to return the first argument.
+ * @return Expression
+ */
public Expression getArg1() {
return args[0];
}
+ /**
+ * Convenience method to return the second argument.
+ * @return Expression
+ */
public Expression getArg2() {
return args[1];
}
+ /**
+ * Convenience method to return the third argument.
+ * @return Expression
+ */
public Expression getArg3() {
return args[2];
}
+ /**
+ * Return the number of argument Expressions.
+ * @return int count
+ */
public int getArgumentCount() {
if (args == null) {
return 0;
@@ -188,6 +217,9 @@
return false;
}
+ /**
+ * {@inheritDoc}
+ */
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append(getFunctionName());
@@ -205,12 +237,15 @@
return buffer.toString();
}
+ /**
+ * {@inheritDoc}
+ */
public Object compute(EvalContext context) {
return computeValue(context);
}
/**
- * Computes a built-in function
+ * {@inheritDoc}
*/
public Object computeValue(EvalContext context) {
switch (functionCode) {
@@ -278,6 +313,11 @@
return null;
}
+ /**
+ * last() implementation.
+ * @param context evaluation context
+ * @return Number
+ */
protected Object functionLast(EvalContext context) {
assertArgCount(0);
// Move the position to the beginning and iterate through
@@ -296,11 +336,21 @@
return new Double(count);
}
+ /**
+ * position() implementation.
+ * @param context evaluation context
+ * @return Number
+ */
protected Object functionPosition(EvalContext context) {
assertArgCount(0);
return new Integer(context.getCurrentPosition());
}
+ /**
+ * count() implementation.
+ * @param context evaluation context
+ * @return Number
+ */
protected Object functionCount(EvalContext context) {
assertArgCount(1);
Expression arg1 = getArg1();
@@ -328,6 +378,11 @@
return new Double(count);
}
+ /**
+ * lang() implementation.
+ * @param context evaluation context
+ * @return Boolean
+ */
protected Object functionLang(EvalContext context) {
assertArgCount(1);
String lang = InfoSetUtil.stringValue(getArg1().computeValue(context));
@@ -338,6 +393,11 @@
return pointer.isLanguage(lang) ? Boolean.TRUE : Boolean.FALSE;
}
+ /**
+ * id() implementation.
+ * @param context evaluation context
+ * @return Pointer
+ */
protected Object functionID(EvalContext context) {
assertArgCount(1);
String id = InfoSetUtil.stringValue(getArg1().computeValue(context));
@@ -346,6 +406,11 @@
return pointer.getPointerByID(jxpathContext, id);
}
+ /**
+ * key() implementation.
+ * @param context evaluation context
+ * @return various Object
+ */
protected Object functionKey(EvalContext context) {
assertArgCount(2);
String key = InfoSetUtil.stringValue(getArg1().computeValue(context));
@@ -373,6 +438,11 @@
return new NodeSetContext(context, nodeSet);
}
+ /**
+ * namespace-uri() implementation.
+ * @param context evaluation context
+ * @return String
+ */
protected Object functionNamespaceURI(EvalContext context) {
if (getArgumentCount() == 0) {
NodePointer ptr = context.getCurrentNodePointer();
@@ -392,6 +462,11 @@
return "";
}
+ /**
+ * local-name() implementation.
+ * @param context evaluation context
+ * @return String
+ */
protected Object functionLocalName(EvalContext context) {
if (getArgumentCount() == 0) {
NodePointer ptr = context.getCurrentNodePointer();
@@ -409,6 +484,11 @@
return "";
}
+ /**
+ * name() implementation.
+ * @param context evaluation context
+ * @return String
+ */
protected Object functionName(EvalContext context) {
if (getArgumentCount() == 0) {
NodePointer ptr = context.getCurrentNodePointer();
@@ -426,6 +506,11 @@
return "";
}
+ /**
+ * string() implementation.
+ * @param context evaluation context
+ * @return String
+ */
protected Object functionString(EvalContext context) {
if (getArgumentCount() == 0) {
return InfoSetUtil.stringValue(context.getCurrentNodePointer());
@@ -434,6 +519,11 @@
return InfoSetUtil.stringValue(getArg1().computeValue(context));
}
+ /**
+ * concat() implementation.
+ * @param context evaluation context
+ * @return String
+ */
protected Object functionConcat(EvalContext context) {
if (getArgumentCount() < 2) {
assertArgCount(2);
@@ -446,6 +536,11 @@
return buffer.toString();
}
+ /**
+ * starts-with() implementation.
+ * @param context evaluation context
+ * @return Boolean
+ */
protected Object functionStartsWith(EvalContext context) {
assertArgCount(2);
String s1 = InfoSetUtil.stringValue(getArg1().computeValue(context));
@@ -453,6 +548,11 @@
return s1.startsWith(s2) ? Boolean.TRUE : Boolean.FALSE;
}
+ /**
+ * contains() implementation.
+ * @param context evaluation context
+ * @return Boolean
+ */
protected Object functionContains(EvalContext context) {
assertArgCount(2);
String s1 = InfoSetUtil.stringValue(getArg1().computeValue(context));
@@ -460,6 +560,11 @@
return s1.indexOf(s2) != -1 ? Boolean.TRUE : Boolean.FALSE;
}
+ /**
+ * substring-before() implementation.
+ * @param context evaluation context
+ * @return String
+ */
protected Object functionSubstringBefore(EvalContext context) {
assertArgCount(2);
String s1 = InfoSetUtil.stringValue(getArg1().computeValue(context));
@@ -471,6 +576,11 @@
return s1.substring(0, index);
}
+ /**
+ * substring-after() implementation.
+ * @param context evaluation context
+ * @return String
+ */
protected Object functionSubstringAfter(EvalContext context) {
assertArgCount(2);
String s1 = InfoSetUtil.stringValue(getArg1().computeValue(context));
@@ -482,6 +592,11 @@
return s1.substring(index + s2.length());
}
+ /**
+ * substring() implementation.
+ * @param context evaluation context
+ * @return String
+ */
protected Object functionSubstring(EvalContext context) {
int ac = getArgumentCount();
if (ac != 2 && ac != 3) {
@@ -529,6 +644,11 @@
return s1.substring((int) from - 1, (int) (to - 1));
}
+ /**
+ * string-length() implementation.
+ * @param context evaluation context
+ * @return Number
+ */
protected Object functionStringLength(EvalContext context) {
String s;
if (getArgumentCount() == 0) {
@@ -541,6 +661,11 @@
return new Double(s.length());
}
+ /**
+ * normalize-space() implementation.
+ * @param context evaluation context
+ * @return String
+ */
protected Object functionNormalizeSpace(EvalContext context) {
assertArgCount(1);
String s = InfoSetUtil.stringValue(getArg1().computeValue(context));
@@ -572,6 +697,11 @@
return new String(chars, 0, out);
}
+ /**
+ * translate() implementation.
+ * @param context evaluation context
+ * @return String
+ */
protected Object functionTranslate(EvalContext context) {
assertArgCount(3);
String s1 = InfoSetUtil.stringValue(getArg1().computeValue(context));
@@ -594,6 +724,11 @@
return new String(chars, 0, out);
}
+ /**
+ * boolean() implementation.
+ * @param context evaluation context
+ * @return Boolean
+ */
protected Object functionBoolean(EvalContext context) {
assertArgCount(1);
return InfoSetUtil.booleanValue(getArg1().computeValue(context))
@@ -601,6 +736,11 @@
: Boolean.FALSE;
}
+ /**
+ * not() implementation.
+ * @param context evaluation context
+ * @return Boolean
+ */
protected Object functionNot(EvalContext context) {
assertArgCount(1);
return InfoSetUtil.booleanValue(getArg1().computeValue(context))
@@ -608,21 +748,41 @@
: Boolean.TRUE;
}
+ /**
+ * true() implementation.
+ * @param context evaluation context
+ * @return Boolean.TRUE
+ */
protected Object functionTrue(EvalContext context) {
assertArgCount(0);
return Boolean.TRUE;
}
+ /**
+ * false() implementation.
+ * @param context evaluation context
+ * @return Boolean.FALSE
+ */
protected Object functionFalse(EvalContext context) {
assertArgCount(0);
return Boolean.FALSE;
}
+ /**
+ * null() implementation.
+ * @param context evaluation context
+ * @return null
+ */
protected Object functionNull(EvalContext context) {
assertArgCount(0);
return null;
}
+ /**
+ * number() implementation.
+ * @param context evaluation context
+ * @return Number
+ */
protected Object functionNumber(EvalContext context) {
if (getArgumentCount() == 0) {
return InfoSetUtil.number(context.getCurrentNodePointer());
@@ -631,6 +791,11 @@
return InfoSetUtil.number(getArg1().computeValue(context));
}
+ /**
+ * sum() implementation.
+ * @param context evaluation context
+ * @return Number
+ */
protected Object functionSum(EvalContext context) {
assertArgCount(1);
Object v = getArg1().compute(context);
@@ -650,6 +815,11 @@
"Invalid argument type for 'sum': " + v.getClass().getName());
}
+ /**
+ * floor() implementation.
+ * @param context evaluation context
+ * @return Number
+ */
protected Object functionFloor(EvalContext context) {
assertArgCount(1);
double v = InfoSetUtil.doubleValue(getArg1().computeValue(context));
@@ -659,6 +829,11 @@
return new Double(Math.floor(v));
}
+ /**
+ * ceiling() implementation.
+ * @param context evaluation context
+ * @return Number
+ */
protected Object functionCeiling(EvalContext context) {
assertArgCount(1);
double v = InfoSetUtil.doubleValue(getArg1().computeValue(context));
@@ -668,6 +843,11 @@
return new Double(Math.ceil(v));
}
+ /**
+ * round() implementation.
+ * @param context evaluation context
+ * @return Number
+ */
protected Object functionRound(EvalContext context) {
assertArgCount(1);
double v = InfoSetUtil.doubleValue(getArg1().computeValue(context));
@@ -677,6 +857,11 @@
return new Double(Math.round(v));
}
+ /**
+ * format-number() implementation.
+ * @param context evaluation context
+ * @return String
+ */
private Object functionFormatNumber(EvalContext context) {
int ac = getArgumentCount();
if (ac != 2 && ac != 3) {
@@ -713,10 +898,19 @@
return format.format(number);
}
+ /**
+ * Assert <code>count</code> args.
+ * @param count int
+ */
private void assertArgCount(int count) {
assertArgRange(count, count);
}
+ /**
+ * Assert at least <code>min</code>/at most <code>max</code> args.
+ * @param min int
+ * @param max int
+ */
private void assertArgRange(int min, int max) {
int ct = getArgumentCount();
if (ct < min || ct > max) {
Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationAdd.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationAdd.java?rev=604304&r1=604303&r2=604304&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationAdd.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationAdd.java Fri Dec 14 13:31:19 2007
@@ -27,10 +27,17 @@
*/
public class CoreOperationAdd extends CoreOperation {
+ /**
+ * Create a new CoreOperationAdd.
+ * @param args Expression arguments to add together.
+ */
public CoreOperationAdd(Expression[] args) {
super(args);
}
+ /**
+ * {@inheritDoc}
+ */
public Object computeValue(EvalContext context) {
double s = 0.0;
for (int i = 0; i < args.length; i++) {
@@ -38,15 +45,24 @@
}
return new Double(s);
}
-
+
+ /**
+ * {@inheritDoc}
+ */
protected int getPrecedence() {
return 4;
}
+ /**
+ * {@inheritDoc}
+ */
protected boolean isSymmetric() {
return true;
}
-
+
+ /**
+ * {@inheritDoc}
+ */
public String getSymbol() {
return "+";
}
Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationEqual.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationEqual.java?rev=604304&r1=604303&r2=604304&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationEqual.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationEqual.java Fri Dec 14 13:31:19 2007
@@ -24,10 +24,18 @@
*/
public class CoreOperationEqual extends CoreOperationCompare {
+ /**
+ * Create a new CoreOperationEqual
+ * @param arg1 first comparison Expression
+ * @param arg2 second comparison Expression
+ */
public CoreOperationEqual(Expression arg1, Expression arg2) {
super(arg1, arg2);
}
+ /**
+ * {@inheritDoc}
+ */
public String getSymbol() {
return "=";
}
Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationLessThan.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationLessThan.java?rev=604304&r1=604303&r2=604304&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationLessThan.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/compiler/CoreOperationLessThan.java Fri Dec 14 13:31:19 2007
@@ -24,14 +24,25 @@
*/
public class CoreOperationLessThan extends CoreOperationRelationalExpression {
+ /**
+ * Create a new CoreOperationLessThan.
+ * @param arg1 left Expression
+ * @param arg2 right Expression
+ */
public CoreOperationLessThan(Expression arg1, Expression arg2) {
super(new Expression[] { arg1, arg2 });
}
+ /**
+ * {@inheritDoc}
+ */
protected boolean evaluateCompare(int compare) {
return compare < 0;
}
+ /**
+ * {@inheritDoc}
+ */
public String getSymbol() {
return "<";
}
Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/NodePointerFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/NodePointerFactory.java?rev=604304&r1=604303&r2=604304&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/NodePointerFactory.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/NodePointerFactory.java Fri Dec 14 13:31:19 2007
@@ -32,6 +32,7 @@
/**
* The factory order number determines its position between other factories.
+ * @return int order
*/
int getOrder();
@@ -39,6 +40,9 @@
* Create a NodePointer for the supplied object. The node will represent
* the "root" object for a path.
*
+ * @param name String node name
+ * @param object child object
+ * @param locale Locale
* @return null if this factory does not recognize objects of the supplied
* type.
*/
@@ -47,6 +51,9 @@
/**
* Create a NodePointer for the supplied child object.
* <p>
+ * @param parent parent node
+ * @param name String node name
+ * @param object child object
* @return null if this factory does not recognize objects of the supplied
* type.
*/
Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/BeanPropertyPointer.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/BeanPropertyPointer.java?rev=604304&r1=604303&r2=604304&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/BeanPropertyPointer.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/BeanPropertyPointer.java Fri Dec 14 13:31:19 2007
@@ -34,14 +34,18 @@
public class BeanPropertyPointer extends PropertyPointer {
private String propertyName;
private JXPathBeanInfo beanInfo;
- private PropertyDescriptor propertyDescriptors[];
+ private PropertyDescriptor[] propertyDescriptors;
private PropertyDescriptor propertyDescriptor;
private String[] names;
private static final Object UNINITIALIZED = new Object();
private Object baseValue = UNINITIALIZED;
private Object value = UNINITIALIZED;
-
+ /**
+ * Create a new BeanPropertyPointer.
+ * @param parent parent pointer
+ * @param beanInfo describes the target property/ies.
+ */
public BeanPropertyPointer(NodePointer parent, JXPathBeanInfo beanInfo) {
super(parent);
this.beanInfo = beanInfo;
@@ -49,13 +53,14 @@
/**
* This type of node is auxiliary.
+ * @return true
*/
public boolean isContainer() {
return true;
}
/**
- * Number of the bean's properties.
+ * {@inheritDoc}
*/
public int getPropertyCount() {
if (beanInfo.isAtomic()) {
@@ -65,7 +70,8 @@
}
/**
- * Names of all properties, sorted alphabetically
+ * Get the names of all properties, sorted alphabetically
+ * @return String[]
*/
public String[] getPropertyNames() {
if (names == null) {
@@ -79,7 +85,8 @@
}
/**
- * Select a property by name
+ * Select a property by name.
+ * @param propertyName String name
*/
public void setPropertyName(String propertyName) {
setPropertyIndex(UNSPECIFIED_PROPERTY);
@@ -88,6 +95,7 @@
/**
* Selects a property by its offset in the alphabetically sorted list.
+ * @param index property index
*/
public void setPropertyIndex(int index) {
if (propertyIndex != index) {
@@ -100,7 +108,8 @@
}
/**
- * The value of the currently selected property.
+ * Get the value of the currently selected property.
+ * @return Object value
*/
public Object getBaseValue() {
if (baseValue == UNINITIALIZED) {
@@ -113,6 +122,9 @@
return baseValue;
}
+ /**
+ * {@inheritDoc}
+ */
public void setIndex(int index) {
if (this.index != index) {
// When dealing with a scalar, index == 0 is equivalent to
@@ -131,6 +143,7 @@
* the value of the index'th element of the collection represented by the
* property. If the property is not a collection, index should be zero
* and the value will be the property itself.
+ * @return Object
*/
public Object getImmediateNode() {
if (value == UNINITIALIZED) {
@@ -150,10 +163,16 @@
return value;
}
+ /**
+ * {@inheritDoc}
+ */
protected boolean isActualProperty() {
return getPropertyDescriptor() != null;
}
+ /**
+ * {@inheritDoc}
+ */
public boolean isCollection() {
PropertyDescriptor pd = getPropertyDescriptor();
if (pd == null) {
@@ -179,6 +198,7 @@
/**
* If the property contains a collection, then the length of that
* collection, otherwise - 1.
+ * @return int length
*/
public int getLength() {
PropertyDescriptor pd = getPropertyDescriptor();
@@ -203,6 +223,7 @@
* If index == WHOLE_COLLECTION, change the value of the property, otherwise
* change the value of the index'th element of the collection
* represented by the property.
+ * @param value value to set
*/
public void setValue(Object value) {
PropertyDescriptor pd = getPropertyDescriptor();
@@ -221,7 +242,7 @@
}
/**
- * @see PropertyPointer#createPath(JXPathContext)
+ * {@inheritDoc}
*/
public NodePointer createPath(JXPathContext context) {
if (getImmediateNode() == null) {
@@ -232,6 +253,9 @@
return this;
}
+ /**
+ * {@inheritDoc}
+ */
public void remove() {
if (index == WHOLE_COLLECTION) {
setValue(null);
@@ -250,7 +274,8 @@
}
/**
- * Name of the currently selected property.
+ * Get the name of the currently selected property.
+ * @return String property name
*/
public String getPropertyName() {
if (propertyName == null) {
@@ -265,6 +290,7 @@
/**
* Finds the property descriptor corresponding to the current property
* index.
+ * @return PropertyDescriptor
*/
private PropertyDescriptor getPropertyDescriptor() {
if (propertyDescriptor == null) {
@@ -274,7 +300,7 @@
beanInfo.getPropertyDescriptor(propertyName);
}
else {
- PropertyDescriptor propertyDescriptors[] =
+ PropertyDescriptor[] propertyDescriptors =
getPropertyDescriptors();
if (inx >= 0 && inx < propertyDescriptors.length) {
propertyDescriptor = propertyDescriptors[inx];
@@ -287,7 +313,11 @@
return propertyDescriptor;
}
- protected PropertyDescriptor[] getPropertyDescriptors() {
+ /**
+ * Get all PropertyDescriptors.
+ * @return PropertyDescriptor[]
+ */
+ protected synchronized PropertyDescriptor[] getPropertyDescriptors() {
if (propertyDescriptors == null) {
propertyDescriptors = beanInfo.getPropertyDescriptors();
}
Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/CollectionPointer.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/CollectionPointer.java?rev=604304&r1=604303&r2=604304&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/CollectionPointer.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/CollectionPointer.java Fri Dec 14 13:31:19 2007
@@ -39,46 +39,80 @@
private Object collection;
private NodePointer valuePointer;
+ /**
+ * Create a new CollectionPointer.
+ * @param collection value
+ * @param locale Locale
+ */
public CollectionPointer(Object collection, Locale locale) {
super(null, locale);
this.collection = collection;
}
+ /**
+ * Create a new CollectionPointer.
+ * @param parent parent NodePointer
+ * @param collection value
+ */
public CollectionPointer(NodePointer parent, Object collection) {
super(parent);
this.collection = collection;
}
+ /**
+ * {@inheritDoc}
+ */
public QName getName() {
return null;
}
+ /**
+ * {@inheritDoc}
+ */
public Object getBaseValue() {
return collection;
}
+ /**
+ * {@inheritDoc}
+ */
public boolean isCollection() {
return true;
}
+ /**
+ * {@inheritDoc}
+ */
public int getLength() {
return ValueUtils.getLength(getBaseValue());
}
+ /**
+ * {@inheritDoc}
+ */
public boolean isLeaf() {
Object value = getNode();
return value == null || JXPathIntrospector.getBeanInfo(value.getClass()).isAtomic();
}
+ /**
+ * {@inheritDoc}
+ */
public boolean isContainer() {
return index != WHOLE_COLLECTION;
}
+ /**
+ * {@inheritDoc}
+ */
public Object getImmediateNode() {
return index == WHOLE_COLLECTION ? ValueUtils.getValue(collection)
: ValueUtils.getValue(collection, index);
}
+ /**
+ * {@inheritDoc}
+ */
public void setValue(Object value) {
if (index == WHOLE_COLLECTION) {
parent.setValue(value);
@@ -88,11 +122,17 @@
}
}
+ /**
+ * {@inheritDoc}
+ */
public void setIndex(int index) {
super.setIndex(index);
valuePointer = null;
}
+ /**
+ * {@inheritDoc}
+ */
public NodePointer getValuePointer() {
if (valuePointer == null) {
if (index == WHOLE_COLLECTION) {
@@ -107,6 +147,9 @@
return valuePointer;
}
+ /**
+ * {@inheritDoc}
+ */
public NodePointer createPath(JXPathContext context) {
Object collection = getBaseValue();
if (ValueUtils.getLength(collection) <= index) {
@@ -115,37 +158,50 @@
return this;
}
+ /**
+ * {@inheritDoc}
+ */
public NodePointer createPath(JXPathContext context, Object value) {
NodePointer ptr = createPath(context);
ptr.setValue(value);
return ptr;
}
+ /**
+ * {@inheritDoc}
+ */
public NodePointer createChild(
JXPathContext context,
QName name,
int index,
- Object value)
- {
+ Object value) {
NodePointer ptr = (NodePointer) clone();
ptr.setIndex(index);
return ptr.createPath(context, value);
}
+ /**
+ * {@inheritDoc}
+ */
public NodePointer createChild(
JXPathContext context,
QName name,
- int index)
- {
+ int index) {
NodePointer ptr = (NodePointer) clone();
ptr.setIndex(index);
return ptr.createPath(context);
}
+ /**
+ * {@inheritDoc}
+ */
public int hashCode() {
return System.identityHashCode(collection) + index;
}
+ /**
+ * {@inheritDoc}
+ */
public boolean equals(Object object) {
if (object == this) {
return true;
@@ -159,9 +215,11 @@
return collection == other.collection && index == other.index;
}
- public NodeIterator childIterator(NodeTest test,
- boolean reverse, NodePointer startWith)
- {
+ /**
+ * {@inheritDoc}
+ */
+ public NodeIterator childIterator(NodeTest test,
+ boolean reverse, NodePointer startWith) {
if (index == WHOLE_COLLECTION) {
return new CollectionChildNodeIterator(
this,
@@ -172,19 +230,31 @@
return getValuePointer().childIterator(test, reverse, startWith);
}
+ /**
+ * {@inheritDoc}
+ */
public NodeIterator attributeIterator(QName name) {
return index == WHOLE_COLLECTION ? new CollectionAttributeNodeIterator(this, name)
: getValuePointer().attributeIterator(name);
}
+ /**
+ * {@inheritDoc}
+ */
public NodeIterator namespaceIterator() {
return index == WHOLE_COLLECTION ? null : getValuePointer().namespaceIterator();
}
+ /**
+ * {@inheritDoc}
+ */
public NodePointer namespacePointer(String namespace) {
return index == WHOLE_COLLECTION ? null : getValuePointer().namespacePointer(namespace);
}
+ /**
+ * {@inheritDoc}
+ */
public boolean testNode(NodeTest test) {
if (index == WHOLE_COLLECTION) {
if (test == null) {
@@ -198,14 +268,16 @@
return getValuePointer().testNode(test);
}
+ /**
+ * {@inheritDoc}
+ */
public int compareChildNodePointers(
- NodePointer pointer1, NodePointer pointer2)
- {
+ NodePointer pointer1, NodePointer pointer2) {
return pointer1.getIndex() - pointer2.getIndex();
}
/**
- * Returns an XPath that maps to this Pointer.
+ * {@inheritDoc}
*/
public String asPath() {
StringBuffer buffer = new StringBuffer();
Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/LangAttributePointer.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/LangAttributePointer.java?rev=604304&r1=604303&r2=604304&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/LangAttributePointer.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/LangAttributePointer.java Fri Dec 14 13:31:19 2007
@@ -28,40 +28,66 @@
* @version $Revision$ $Date$
*/
public class LangAttributePointer extends NodePointer {
+ /**
+ * Create a new LangAttributePointer.
+ * @param parent parent pointer.
+ */
public LangAttributePointer(NodePointer parent) {
super(parent);
}
+ /**
+ * {@inheritDoc}
+ */
public QName getName() {
return new QName("xml", "lang");
}
+ /**
+ * {@inheritDoc}
+ */
public String getNamespaceURI() {
return null;
}
+ /**
+ * {@inheritDoc}
+ */
public boolean isCollection() {
return false;
}
+ /**
+ * {@inheritDoc}
+ */
public int getLength() {
return 1;
}
+ /**
+ * {@inheritDoc}
+ */
public Object getBaseValue() {
return parent.getLocale().toString().replace('_', '-');
}
+ /**
+ * {@inheritDoc}
+ */
public Object getImmediateNode() {
return getBaseValue();
}
+ /**
+ * {@inheritDoc}
+ */
public boolean isLeaf() {
return true;
}
/**
* Throws UnsupportedOperationException.
+ * @param value Object
*/
public void setValue(Object value) {
throw new UnsupportedOperationException(
@@ -69,6 +95,7 @@
}
/**
+ * {@inheritDoc}
*/
public String asPath() {
StringBuffer buffer = new StringBuffer();
@@ -83,22 +110,33 @@
return buffer.toString();
}
+ /**
+ * {@inheritDoc}
+ */
public int hashCode() {
return 0;
}
+ /**
+ * {@inheritDoc}
+ */
public boolean equals(Object object) {
return object instanceof LangAttributePointer;
}
+ /**
+ * {@inheritDoc}
+ */
public boolean testNode(NodeTest test) {
return false;
}
+ /**
+ * {@inheritDoc}
+ */
public int compareChildNodePointers(
NodePointer pointer1,
- NodePointer pointer2)
- {
+ NodePointer pointer2) {
// Won't happen - lang attributes don't have children
return 0;
}
Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/PropertyPointer.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/PropertyPointer.java?rev=604304&r1=604303&r2=604304&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/PropertyPointer.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/beans/PropertyPointer.java Fri Dec 14 13:31:19 2007
@@ -35,21 +35,33 @@
public abstract class PropertyPointer extends NodePointer {
public static final int UNSPECIFIED_PROPERTY = Integer.MIN_VALUE;
+ /** property index */
protected int propertyIndex = UNSPECIFIED_PROPERTY;
+
+ /** owning object */
protected Object bean;
/**
* Takes a javabean, a descriptor of a property of that object and
* an offset within that property (starting with 0).
+ * @param parent parent pointer
*/
public PropertyPointer(NodePointer parent) {
super(parent);
}
+ /**
+ * Get the property index.
+ * @return int index
+ */
public int getPropertyIndex() {
return propertyIndex;
}
+ /**
+ * Set the property index.
+ * @param index property index
+ */
public void setPropertyIndex(int index) {
if (propertyIndex != index) {
propertyIndex = index;
@@ -57,6 +69,10 @@
}
}
+ /**
+ * Get the parent bean.
+ * @return Object
+ */
public Object getBean() {
if (bean == null) {
bean = getImmediateParentPointer().getNode();
@@ -64,20 +80,46 @@
return bean;
}
+ /**
+ * {@inheritDoc}
+ */
public QName getName() {
return new QName(null, getPropertyName());
}
+ /**
+ * Get the property name.
+ * @return String property name.
+ */
public abstract String getPropertyName();
+ /**
+ * Set the property name.
+ * @param propertyName property name to set.
+ */
public abstract void setPropertyName(String propertyName);
+ /**
+ * Count the number of properties represented.
+ * @return int
+ */
public abstract int getPropertyCount();
+ /**
+ * Get the names of the included properties.
+ * @return String[]
+ */
public abstract String[] getPropertyNames();
+ /**
+ * Learn whether this pointer references an actual property.
+ * @return true if actual
+ */
protected abstract boolean isActualProperty();
+ /**
+ * {@inheritDoc}
+ */
public boolean isActual() {
if (!isActualProperty()) {
return false;
@@ -89,6 +131,10 @@
private static final Object UNINITIALIZED = new Object();
private Object value = UNINITIALIZED;
+
+ /**
+ * {@inheritDoc}
+ */
public Object getImmediateNode() {
if (value == UNINITIALIZED) {
value = index == WHOLE_COLLECTION ? ValueUtils.getValue(getBaseValue())
@@ -96,12 +142,18 @@
}
return value;
}
-
+
+ /**
+ * {@inheritDoc}
+ */
public boolean isCollection() {
Object value = getBaseValue();
return value != null && ValueUtils.isCollection(value);
}
-
+
+ /**
+ * {@inheritDoc}
+ */
public boolean isLeaf() {
Object value = getNode();
return value == null || JXPathIntrospector.getBeanInfo(value.getClass()).isAtomic();
@@ -110,15 +162,16 @@
/**
* If the property contains a collection, then the length of that
* collection, otherwise - 1.
+ * @return int length
*/
public int getLength() {
return ValueUtils.getLength(getBaseValue());
}
-
/**
* Returns a NodePointer that can be used to access the currently
* selected property value.
+ * @return NodePointer
*/
public NodePointer getImmediateValuePointer() {
return NodePointer.newChildNodePointer(
@@ -127,6 +180,9 @@
getImmediateNode());
}
+ /**
+ * {@inheritDoc}
+ */
public NodePointer createPath(JXPathContext context) {
if (getImmediateNode() == null) {
AbstractFactory factory = getAbstractFactory(context);
@@ -146,21 +202,26 @@
return this;
}
+ /**
+ * {@inheritDoc}
+ */
public NodePointer createPath(JXPathContext context, Object value) {
// If neccessary, expand collection
if (index != WHOLE_COLLECTION && index >= getLength()) {
createPath(context);
}
- setValue(value);
+ setValue(value);
return this;
}
+ /**
+ * {@inheritDoc}
+ */
public NodePointer createChild(
JXPathContext context,
QName name,
int index,
- Object value)
- {
+ Object value) {
PropertyPointer prop = (PropertyPointer) clone();
if (name != null) {
prop.setPropertyName(name.toString());
@@ -169,11 +230,13 @@
return prop.createPath(context, value);
}
+ /**
+ * {@inheritDoc}
+ */
public NodePointer createChild(
JXPathContext context,
QName name,
- int index)
- {
+ int index) {
PropertyPointer prop = (PropertyPointer) clone();
if (name != null) {
prop.setPropertyName(name.toString());
@@ -182,10 +245,16 @@
return prop.createPath(context);
}
+ /**
+ * {@inheritDoc}
+ */
public int hashCode() {
return getImmediateParentPointer().hashCode() + propertyIndex + index;
}
+ /**
+ * {@inheritDoc}
+ */
public boolean equals(Object object) {
if (object == this) {
return true;
@@ -210,13 +279,21 @@
return iThis == iOther;
}
+ /**
+ * {@inheritDoc}
+ */
public int compareChildNodePointers(
NodePointer pointer1,
- NodePointer pointer2)
- {
+ NodePointer pointer2) {
return getValuePointer().compareChildNodePointers(pointer1, pointer2);
}
-
+
+ /**
+ * Get the required AbstractFactory configured on the specified JXPathContext.
+ * @param context JXPathContext
+ * @return AbstractFactory
+ * @throws JXPathException if no factory configured.
+ */
private AbstractFactory getAbstractFactory(JXPathContext context) {
AbstractFactory factory = context.getFactory();
if (factory == null) {
Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dom/NamespacePointer.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dom/NamespacePointer.java?rev=604304&r1=604303&r2=604304&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dom/NamespacePointer.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dom/NamespacePointer.java Fri Dec 14 13:31:19 2007
@@ -32,41 +32,69 @@
private String prefix;
private String namespaceURI;
+ /**
+ * Create a new NamespacePointer.
+ * @param parent parent pointer
+ * @param prefix associated ns prefix.
+ */
public NamespacePointer(NodePointer parent, String prefix) {
super(parent);
this.prefix = prefix;
}
+ /**
+ * Create a new NamespacePointer.
+ * @param parent parent pointer
+ * @param prefix associated ns prefix.
+ * @param namespaceURI associated ns URI.
+ */
public NamespacePointer(
NodePointer parent,
String prefix,
- String namespaceURI)
- {
+ String namespaceURI) {
super(parent);
this.prefix = prefix;
this.namespaceURI = namespaceURI;
}
+ /**
+ * {@inheritDoc}
+ */
public QName getName() {
return new QName(prefix);
}
+ /**
+ * {@inheritDoc}
+ */
public Object getBaseValue() {
return null;
}
-
+
+ /**
+ * {@inheritDoc}
+ */
public boolean isCollection() {
return false;
}
-
+
+ /**
+ * {@inheritDoc}
+ */
public int getLength() {
return 1;
- }
+ }
+ /**
+ * {@inheritDoc}
+ */
public Object getImmediateNode() {
return getNamespaceURI();
}
+ /**
+ * {@inheritDoc}
+ */
public String getNamespaceURI() {
if (namespaceURI == null) {
namespaceURI = parent.getNamespaceURI(prefix);
@@ -74,17 +102,24 @@
return namespaceURI;
}
+ /**
+ * {@inheritDoc}
+ */
public boolean isLeaf() {
return true;
}
/**
* Throws UnsupportedOperationException.
+ * @param value Object
*/
public void setValue(Object value) {
throw new UnsupportedOperationException("Cannot modify DOM trees");
}
+ /**
+ * {@inheritDoc}
+ */
public boolean testNode(NodeTest nodeTest) {
return nodeTest == null
|| ((nodeTest instanceof NodeTypeTest)
@@ -92,6 +127,9 @@
== Compiler.NODE_TYPE_NODE);
}
+ /**
+ * {@inheritDoc}
+ */
public String asPath() {
StringBuffer buffer = new StringBuffer();
if (parent != null) {
@@ -106,10 +144,16 @@
return buffer.toString();
}
+ /**
+ * {@inheritDoc}
+ */
public int hashCode() {
return prefix.hashCode();
}
+ /**
+ * {@inheritDoc}
+ */
public boolean equals(Object object) {
if (object == this) {
return true;
@@ -123,10 +167,12 @@
return prefix.equals(other.prefix);
}
+ /**
+ * {@inheritDoc}
+ */
public int compareChildNodePointers(
NodePointer pointer1,
- NodePointer pointer2)
- {
+ NodePointer pointer2) {
// Won't happen - namespaces don't have children
return 0;
}
Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicPointerFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicPointerFactory.java?rev=604304&r1=604303&r2=604304&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicPointerFactory.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicPointerFactory.java Fri Dec 14 13:31:19 2007
@@ -35,17 +35,25 @@
*/
public class DynamicPointerFactory implements NodePointerFactory {
+ /**
+ * Factory order constant.
+ */
public static final int DYNAMIC_POINTER_FACTORY_ORDER = 800;
+ /**
+ * {@inheritDoc}
+ */
public int getOrder() {
return DYNAMIC_POINTER_FACTORY_ORDER;
}
+ /**
+ * {@inheritDoc}
+ */
public NodePointer createNodePointer(
QName name,
Object bean,
- Locale locale)
- {
+ Locale locale) {
JXPathBeanInfo bi = JXPathIntrospector.getBeanInfo(bean.getClass());
if (bi.isDynamic()) {
DynamicPropertyHandler handler =
@@ -56,11 +64,13 @@
return null;
}
+ /**
+ * {@inheritDoc}
+ */
public NodePointer createNodePointer(
NodePointer parent,
QName name,
- Object bean)
- {
+ Object bean) {
if (bean == null) {
return new NullPointer(parent, name);
}
Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicPropertyIterator.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicPropertyIterator.java?rev=604304&r1=604303&r2=604304&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicPropertyIterator.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicPropertyIterator.java Fri Dec 14 13:31:19 2007
@@ -22,18 +22,24 @@
/**
* @deprecated - no longer needed, as it is identical to PropertyIterator.
- *
+ *
* @author <a href="mailto:dmitri@apache.org">Dmitri Plotnikov</a>
* @version $Id$
*/
public class DynamicPropertyIterator extends PropertyIterator {
+ /**
+ * Create a new DynamicPropertyIterator
+ * @param pointer PropertyOwnerPointer
+ * @param name String
+ * @param reverse iteration order
+ * @param startWith beginning child
+ */
public DynamicPropertyIterator(
PropertyOwnerPointer pointer,
String name,
boolean reverse,
- NodePointer startWith)
- {
+ NodePointer startWith) {
super(pointer, name, reverse, startWith);
}
}
Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/jdom/JDOMAttributePointer.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/jdom/JDOMAttributePointer.java?rev=604304&r1=604303&r2=604304&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/jdom/JDOMAttributePointer.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/model/jdom/JDOMAttributePointer.java Fri Dec 14 13:31:19 2007
@@ -40,12 +40,18 @@
this.attr = attr;
}
+ /**
+ * {@inheritDoc}
+ */
public QName getName() {
return new QName(
JDOMNodePointer.getPrefix(attr),
JDOMNodePointer.getLocalName(attr));
}
+ /**
+ * {@inheritDoc}
+ */
public String getNamespaceURI() {
String uri = attr.getNamespaceURI();
if (uri != null && uri.equals("")) {
@@ -54,46 +60,71 @@
return uri;
}
+ /**
+ * {@inheritDoc}
+ */
public Object getValue() {
return attr.getValue();
}
+ /**
+ * {@inheritDoc}
+ */
public Object getBaseValue() {
return attr;
}
+ /**
+ * {@inheritDoc}
+ */
public boolean isCollection() {
return false;
}
+ /**
+ * {@inheritDoc}
+ */
public int getLength() {
return 1;
}
+ /**
+ * {@inheritDoc}
+ */
public Object getImmediateNode() {
return attr;
}
+ /**
+ * {@inheritDoc}
+ */
public boolean isActual() {
return true;
}
+ /**
+ * {@inheritDoc}
+ */
public boolean isLeaf() {
return true;
}
/**
- * Sets the value of this attribute.
+ * {@inheritDoc}
*/
public void setValue(Object value) {
attr.setValue((String) TypeUtils.convert(value, String.class));
}
+ /**
+ * {@inheritDoc}
+ */
public void remove() {
attr.getParent().removeAttribute(attr);
}
/**
+ * {@inheritDoc}
*/
public String asPath() {
StringBuffer buffer = new StringBuffer();
@@ -109,15 +140,24 @@
return buffer.toString();
}
+ /**
+ * {@inheritDoc}
+ */
public int hashCode() {
return System.identityHashCode(attr);
}
+ /**
+ * {@inheritDoc}
+ */
public boolean equals(Object object) {
return object == this || object instanceof JDOMAttributePointer
&& ((JDOMAttributePointer) object).attr == attr;
}
+ /**
+ * {@inheritDoc}
+ */
public int compareChildNodePointers(
NodePointer pointer1,
NodePointer pointer2) {
Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/HttpSessionAndServletContext.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/HttpSessionAndServletContext.java?rev=604304&r1=604303&r2=604304&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/HttpSessionAndServletContext.java (original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/servlet/HttpSessionAndServletContext.java Fri Dec 14 13:31:19 2007
@@ -30,16 +30,29 @@
private HttpSession session;
private ServletContext context;
+ /**
+ * Create a new HttpSessionAndServletContext.
+ * @param session HttpSession
+ * @param context ServletContext
+ */
public HttpSessionAndServletContext(HttpSession session,
ServletContext context) {
this.session = session;
this.context = context;
}
-
+
+ /**
+ * Get the session.
+ * @return HttpSession
+ */
public HttpSession getSession() {
return session;
}
-
+
+ /**
+ * Get the ServletContext.
+ * @return ServletContext
+ */
public ServletContext getServletContext() {
return context;
}
Added: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/package.html
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/package.html?rev=604304&view=auto
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/package.html (added)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/package.html Fri Dec 14 13:31:19 2007
@@ -0,0 +1,19 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<body>
+Utility classes to assist with JXPath implementation(s) and/or usage.
+</body>
Propchange: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/util/package.html
------------------------------------------------------------------------------
svn:eol-style = native