You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by st...@apache.org on 2004/09/06 19:11:09 UTC

cvs commit: jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/core PropertyId.java NodeId.java

stefan      2004/09/06 10:11:09

  Modified:    proposals/jcrri/src/org/apache/slide/jcr/core
                        PropertyId.java NodeId.java
  Log:
  jcrri: implementing REFRERENCES type & minor fixes
  
  Revision  Changes    Path
  1.9       +27 -1     jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/core/PropertyId.java
  
  Index: PropertyId.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/core/PropertyId.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- PropertyId.java	2 Aug 2004 16:21:04 -0000	1.8
  +++ PropertyId.java	6 Sep 2004 17:11:09 -0000	1.9
  @@ -66,6 +66,32 @@
   	return false;
       }
   
  +    /**
  +     * Returns a <code>PropertyId</code> holding the value of the specified
  +     * string. The string must be in the format returned by the
  +     * <code>PropertyId.toString()</code> method.
  +     *
  +     * @param s a <code>String</code> containing the <code>PropertyId</code>
  +     *          representation to be parsed.
  +     * @return the <code>PropertyId</code> represented by the argument
  +     * @throws IllegalArgumentException if the specified string can not be parsed
  +     *                                  as a <code>PropertyId</code>.
  +     * @see #toString()
  +     */
  +    public static PropertyId valueOf(String s) {
  +	if (s == null) {
  +	    throw new IllegalArgumentException("invalid PropertyId literal");
  +	}
  +	int i = s.indexOf('/');
  +	if (i == -1) {
  +	    throw new IllegalArgumentException("invalid PropertyId literal");
  +	}
  +	String uuid = s.substring(0, i);
  +	QName name = QName.valueOf(s.substring(i + 1));
  +
  +	return new PropertyId(uuid, name);
  +    }
  +
       public String toString() {
   	return parentUUID + "/" + propName.toString();
       }
  
  
  
  1.9       +20 -1     jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/core/NodeId.java
  
  Index: NodeId.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/core/NodeId.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- NodeId.java	2 Aug 2004 16:21:04 -0000	1.8
  +++ NodeId.java	6 Sep 2004 17:11:09 -0000	1.9
  @@ -56,6 +56,25 @@
   	return false;
       }
   
  +    /**
  +     * Returns a <code>NodeId</code> holding the value of the specified
  +     * string. The string must be in the format returned by the
  +     * <code>NodeId.toString()</code> method.
  +     *
  +     * @param s a <code>String</code> containing the <code>NodeId</code>
  +     *          representation to be parsed.
  +     * @return the <code>NodeId</code> represented by the argument
  +     * @throws IllegalArgumentException if the specified string can not be parsed
  +     *                                  as a <code>NodeId</code>.
  +     * @see #toString()
  +     */
  +    public static NodeId valueOf(String s) {
  +	if (s == null) {
  +	    throw new IllegalArgumentException("invalid NodeId literal");
  +	}
  +	return new NodeId(s);
  +    }
  +
       public String toString() {
   	return uuid;
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org