jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From field...@apache.org
Subject svn commit: r149514 [10/13] - in incubator/jackrabbit/site: ./ apidocs/ apidocs/org/apache/jackrabbit/core/ apidocs/org/apache/jackrabbit/core/class-use/ apidocs/org/apache/jackrabbit/core/search/ apidocs/org/apache/jackrabbit/core/search/class-use/ apidocs/org/apache/jackrabbit/core/state/class-use/ apidocs/org/apache/jackrabbit/core/state/mem/ apidocs/org/apache/jackrabbit/core/state/obj/ apidocs/org/apache/jackrabbit/core/state/xml/ apidocs/org/apache/jackrabbit/core/version/ apidocs/org/apache/jackrabbit/core/xml/ xref-test/ xref-test/org/apache/jackrabbit/test/ xref-test/org/apache/jackrabbit/test/search/ xref/ xref/org/apache/jackrabbit/core/ xref/org/apache/jackrabbit/core/nodetype/ xref/org/apache/jackrabbit/core/search/ xref/org/apache/jackrabbit/core/search/lucene/ xref/org/apache/jackrabbit/core/version/
Date Wed, 02 Feb 2005 14:05:11 GMT
Modified: incubator/jackrabbit/site/xref/org/apache/jackrabbit/core/NodeImpl.html
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/site/xref/org/apache/jackrabbit/core/NodeImpl.html?view=diff&r1=149513&r2=149514
==============================================================================
--- incubator/jackrabbit/site/xref/org/apache/jackrabbit/core/NodeImpl.html (original)
+++ incubator/jackrabbit/site/xref/org/apache/jackrabbit/core/NodeImpl.html Wed Feb  2 06:04:46 2005
@@ -9,7 +9,7 @@
 
 <a name="1" href="#1">1</a>   <em class="comment">/*</em>
 <a name="2" href="#2">2</a>   <em class="comment"> * Copyright 2004-2005 The Apache Software Foundation or its licensors,</em>
-<a name="3" href="#3">3</a>   <em class="comment"> *                     as applicable.</em>
+<a name="3" href="#3">3</a>   <em class="comment">  *                     as applicable.</em>
 <a name="4" href="#4">4</a>   <em class="comment">  *</em>
 <a name="5" href="#5">5</a>   <em class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</em>
 <a name="6" href="#6">6</a>   <em class="comment"> * you may not use this file except in compliance with the License.</em>
@@ -357,8 +357,8 @@
 <a name="348" href="#348">348</a>             log.error(msg);
 <a name="349" href="#349">349</a>             <strong>throw</strong> <strong>new</strong> RepositoryException(msg);
 <a name="350" href="#350">350</a>         }
-<a name="351" href="#351">351</a>         <em class="comment">// check if versioning allows write (only cheap call)</em>
-<a name="352" href="#352">352</a>         <strong>if</strong> (!isCheckedOut(false)) {
+<a name="351" href="#351">351</a>         <em class="comment">// make sure this node is checked-out</em>
+<a name="352" href="#352">352</a>         <strong>if</strong> (!internalIsCheckedOut()) {
 <a name="353" href="#353">353</a>             String msg = <span class="string">"Cannot set the value of a property of a checked-in node "</span> + safeGetJCRPath() + <span class="string">"/"</span> + name.toString();
 <a name="354" href="#354">354</a>             log.error(msg);
 <a name="355" href="#355">355</a>             <strong>throw</strong> <strong>new</strong> VersionException(msg);
@@ -839,2618 +839,2623 @@
 <a name="830" href="#830">830</a>     }
 <a name="831" href="#831">831</a> 
 <a name="832" href="#832">832</a>     <em>/**<em>*</em></em>
-<a name="833" href="#833">833</a> <em>     * Returns the (internal) uuid of this node.</em>
-<a name="834" href="#834">834</a> <em>     * @return the uuid of this node</em>
-<a name="835" href="#835">835</a> <em>     */</em>
-<a name="836" href="#836">836</a>     <strong>public</strong> String internalGetUUID() {
-<a name="837" href="#837">837</a>         <strong>return</strong> ((NodeState) state).getUUID();
-<a name="838" href="#838">838</a>     }
-<a name="839" href="#839">839</a> 
-<a name="840" href="#840">840</a>     <em>/**<em>*</em></em>
-<a name="841" href="#841">841</a> <em>     * Sets the internal value of a property without checking any constraints.</em>
-<a name="842" href="#842">842</a> <em>     * &lt;p/></em>
-<a name="843" href="#843">843</a> <em>     * Note that no type conversion is being performed, i.e. it's the caller's</em>
-<a name="844" href="#844">844</a> <em>     * responsibility to make sure that the type of the given value is compatible</em>
-<a name="845" href="#845">845</a> <em>     * with the specified property's definition.</em>
-<a name="846" href="#846">846</a> <em>     *</em>
-<a name="847" href="#847">847</a> <em>     * @param name</em>
-<a name="848" href="#848">848</a> <em>     * @param value</em>
-<a name="849" href="#849">849</a> <em>     * @return</em>
-<a name="850" href="#850">850</a> <em>     * @throws ValueFormatException</em>
-<a name="851" href="#851">851</a> <em>     * @throws RepositoryException</em>
-<a name="852" href="#852">852</a> <em>     */</em>
-<a name="853" href="#853">853</a>     <strong>public</strong> Property internalSetProperty(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name, <a href="../../../../org/apache/jackrabbit/core/InternalValue.html">InternalValue</a> value)
-<a name="854" href="#854">854</a>             throws ValueFormatException, RepositoryException {
-<a name="855" href="#855">855</a>         <em class="comment">// check state of this instance</em>
-<a name="856" href="#856">856</a>         sanityCheck();
-<a name="857" href="#857">857</a> 
-<a name="858" href="#858">858</a>         <strong>int</strong> type;
-<a name="859" href="#859">859</a>         <strong>if</strong> (value == <strong>null</strong>) {
-<a name="860" href="#860">860</a>             type = PropertyType.STRING;
-<a name="861" href="#861">861</a>         } <strong>else</strong> {
-<a name="862" href="#862">862</a>             type = value.getType();
-<a name="863" href="#863">863</a>         }
-<a name="864" href="#864">864</a> 
-<a name="865" href="#865">865</a>         BitSet status = <strong>new</strong> BitSet();
-<a name="866" href="#866">866</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> prop = getOrCreateProperty(name, type, false, status);
-<a name="867" href="#867">867</a>         <strong>try</strong> {
-<a name="868" href="#868">868</a>             <strong>if</strong> (value == <strong>null</strong>) {
-<a name="869" href="#869">869</a>                 prop.internalSetValue(<strong>null</strong>, type);
-<a name="870" href="#870">870</a>             } <strong>else</strong> {
-<a name="871" href="#871">871</a>                 prop.internalSetValue(<strong>new</strong> <a href="../../../../org/apache/jackrabbit/core/InternalValue.html">InternalValue</a>[]{value}, type);
-<a name="872" href="#872">872</a>             }
-<a name="873" href="#873">873</a>         } <strong>catch</strong> (RepositoryException re) {
-<a name="874" href="#874">874</a>             <strong>if</strong> (status.get(CREATED)) {
-<a name="875" href="#875">875</a>                 <em class="comment">// setting value failed, get rid of newly created property</em>
-<a name="876" href="#876">876</a>                 removeChildProperty(name);
-<a name="877" href="#877">877</a>             }
-<a name="878" href="#878">878</a>             <em class="comment">// rethrow</em>
-<a name="879" href="#879">879</a>             <strong>throw</strong> re;
-<a name="880" href="#880">880</a>         }
-<a name="881" href="#881">881</a>         <strong>return</strong> prop;
-<a name="882" href="#882">882</a>     }
-<a name="883" href="#883">883</a> 
-<a name="884" href="#884">884</a>     <em>/**<em>*</em></em>
-<a name="885" href="#885">885</a> <em>     * Sets the internal value of a property without checking any constraints.</em>
-<a name="886" href="#886">886</a> <em>     * &lt;p/></em>
-<a name="887" href="#887">887</a> <em>     * Note that no type conversion is being performed, i.e. it's the caller's</em>
-<a name="888" href="#888">888</a> <em>     * responsibility to make sure that the type of the given values is compatible</em>
-<a name="889" href="#889">889</a> <em>     * with the specified property's definition.</em>
-<a name="890" href="#890">890</a> <em>     *</em>
-<a name="891" href="#891">891</a> <em>     * @param name</em>
-<a name="892" href="#892">892</a> <em>     * @param values</em>
-<a name="893" href="#893">893</a> <em>     * @return</em>
-<a name="894" href="#894">894</a> <em>     * @throws ValueFormatException</em>
-<a name="895" href="#895">895</a> <em>     * @throws RepositoryException</em>
-<a name="896" href="#896">896</a> <em>     */</em>
-<a name="897" href="#897">897</a>     <strong>protected</strong> Property internalSetProperty(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name, <a href="../../../../org/apache/jackrabbit/core/InternalValue.html">InternalValue</a>[] values)
-<a name="898" href="#898">898</a>             throws ValueFormatException, RepositoryException {
-<a name="899" href="#899">899</a>         <em class="comment">// check state of this instance</em>
-<a name="900" href="#900">900</a>         sanityCheck();
-<a name="901" href="#901">901</a> 
-<a name="902" href="#902">902</a>         <strong>int</strong> type;
-<a name="903" href="#903">903</a>         <strong>if</strong> (values == <strong>null</strong> || values.length == 0) {
-<a name="904" href="#904">904</a>             type = PropertyType.STRING;
-<a name="905" href="#905">905</a>         } <strong>else</strong> {
-<a name="906" href="#906">906</a>             type = values[0].getType();
-<a name="907" href="#907">907</a>         }
-<a name="908" href="#908">908</a> 
-<a name="909" href="#909">909</a>         BitSet status = <strong>new</strong> BitSet();
-<a name="910" href="#910">910</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> prop = getOrCreateProperty(name, type, <strong>true</strong>, status);
-<a name="911" href="#911">911</a>         <strong>try</strong> {
-<a name="912" href="#912">912</a>             prop.internalSetValue(values, type);
-<a name="913" href="#913">913</a>         } <strong>catch</strong> (RepositoryException re) {
-<a name="914" href="#914">914</a>             <strong>if</strong> (status.get(CREATED)) {
-<a name="915" href="#915">915</a>                 <em class="comment">// setting value failed, get rid of newly created property</em>
-<a name="916" href="#916">916</a>                 removeChildProperty(name);
-<a name="917" href="#917">917</a>             }
-<a name="918" href="#918">918</a>             <em class="comment">// rethrow</em>
-<a name="919" href="#919">919</a>             <strong>throw</strong> re;
-<a name="920" href="#920">920</a>         }
-<a name="921" href="#921">921</a>         <strong>return</strong> prop;
-<a name="922" href="#922">922</a>     }
-<a name="923" href="#923">923</a> 
-<a name="924" href="#924">924</a>     <em>/**<em>*</em></em>
-<a name="925" href="#925">925</a> <em>     * Returns the child node of &lt;code>this&lt;/code> node with the specified</em>
-<a name="926" href="#926">926</a> <em>     * &lt;code>name&lt;/code>.</em>
-<a name="927" href="#927">927</a> <em>     *</em>
-<a name="928" href="#928">928</a> <em>     * @param name The qualified name of the child node to retrieve.</em>
-<a name="929" href="#929">929</a> <em>     * @return The child node with the specified &lt;code>name&lt;/code>.</em>
-<a name="930" href="#930">930</a> <em>     * @throws ItemNotFoundException If no child node exists with the</em>
-<a name="931" href="#931">931</a> <em>     *                               specified name.</em>
-<a name="932" href="#932">932</a> <em>     * @throws RepositoryException   If another error occurs.</em>
-<a name="933" href="#933">933</a> <em>     */</em>
-<a name="934" href="#934">934</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/NodeImpl.html">NodeImpl</a> getNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name) throws ItemNotFoundException, RepositoryException {
-<a name="935" href="#935">935</a>         <strong>return</strong> getNode(name, 1);
-<a name="936" href="#936">936</a>     }
-<a name="937" href="#937">937</a> 
-<a name="938" href="#938">938</a>     <em>/**<em>*</em></em>
-<a name="939" href="#939">939</a> <em>     * Returns the child node of &lt;code>this&lt;/code> node with the specified</em>
-<a name="940" href="#940">940</a> <em>     * &lt;code>name&lt;/code>.</em>
-<a name="941" href="#941">941</a> <em>     *</em>
-<a name="942" href="#942">942</a> <em>     * @param name  The qualified name of the child node to retrieve.</em>
-<a name="943" href="#943">943</a> <em>     * @param index The index of the child node to retrieve (in the case of same-name siblings).</em>
-<a name="944" href="#944">944</a> <em>     * @return The child node with the specified &lt;code>name&lt;/code>.</em>
-<a name="945" href="#945">945</a> <em>     * @throws ItemNotFoundException If no child node exists with the</em>
-<a name="946" href="#946">946</a> <em>     *                               specified name.</em>
-<a name="947" href="#947">947</a> <em>     * @throws RepositoryException   If another error occurs.</em>
-<a name="948" href="#948">948</a> <em>     */</em>
-<a name="949" href="#949">949</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/NodeImpl.html">NodeImpl</a> getNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name, <strong>int</strong> index)
-<a name="950" href="#950">950</a>             throws ItemNotFoundException, RepositoryException {
-<a name="951" href="#951">951</a>         <em class="comment">// check state of this instance</em>
-<a name="952" href="#952">952</a>         sanityCheck();
-<a name="953" href="#953">953</a> 
-<a name="954" href="#954">954</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> thisState = (NodeState) state;
-<a name="955" href="#955">955</a>         NodeState.ChildNodeEntry cne = thisState.getChildNodeEntry(name, index);
-<a name="956" href="#956">956</a>         <strong>if</strong> (cne == <strong>null</strong>) {
-<a name="957" href="#957">957</a>             <strong>throw</strong> <strong>new</strong> ItemNotFoundException();
-<a name="958" href="#958">958</a>         }
-<a name="959" href="#959">959</a>         <a href="../../../../org/apache/jackrabbit/core/NodeId.html">NodeId</a> nodeId = <strong>new</strong> <a href="../../../../org/apache/jackrabbit/core/NodeId.html">NodeId</a>(cne.getUUID());
-<a name="960" href="#960">960</a>         <strong>try</strong> {
-<a name="961" href="#961">961</a>             <strong>return</strong> (NodeImpl) itemMgr.getItem(nodeId);
-<a name="962" href="#962">962</a>         } <strong>catch</strong> (AccessDeniedException ade) {
-<a name="963" href="#963">963</a>             <strong>throw</strong> <strong>new</strong> ItemNotFoundException();
-<a name="964" href="#964">964</a>         }
-<a name="965" href="#965">965</a>     }
-<a name="966" href="#966">966</a> 
-<a name="967" href="#967">967</a>     <em>/**<em>*</em></em>
-<a name="968" href="#968">968</a> <em>     * Indicates whether a child node with the specified &lt;code>name&lt;/code> exists.</em>
-<a name="969" href="#969">969</a> <em>     * Returns &lt;code>true&lt;/code> if the child node exists and &lt;code>false&lt;/code></em>
-<a name="970" href="#970">970</a> <em>     * otherwise.</em>
-<a name="971" href="#971">971</a> <em>     *</em>
-<a name="972" href="#972">972</a> <em>     * @param name The qualified name of the child node.</em>
-<a name="973" href="#973">973</a> <em>     * @return &lt;code>true&lt;/code> if the child node exists; &lt;code>false&lt;/code> otherwise.</em>
-<a name="974" href="#974">974</a> <em>     * @throws RepositoryException If an unspecified error occurs.</em>
-<a name="975" href="#975">975</a> <em>     */</em>
-<a name="976" href="#976">976</a>     <strong>public</strong> <strong>boolean</strong> hasNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name) throws RepositoryException {
-<a name="977" href="#977">977</a>         <strong>return</strong> hasNode(name, 1);
-<a name="978" href="#978">978</a>     }
-<a name="979" href="#979">979</a> 
-<a name="980" href="#980">980</a>     <em>/**<em>*</em></em>
-<a name="981" href="#981">981</a> <em>     * Indicates whether a child node with the specified &lt;code>name&lt;/code> exists.</em>
-<a name="982" href="#982">982</a> <em>     * Returns &lt;code>true&lt;/code> if the child node exists and &lt;code>false&lt;/code></em>
-<a name="983" href="#983">983</a> <em>     * otherwise.</em>
-<a name="984" href="#984">984</a> <em>     *</em>
-<a name="985" href="#985">985</a> <em>     * @param name  The qualified name of the child node.</em>
-<a name="986" href="#986">986</a> <em>     * @param index The index of the child node (in the case of same-name siblings).</em>
-<a name="987" href="#987">987</a> <em>     * @return &lt;code>true&lt;/code> if the child node exists; &lt;code>false&lt;/code> otherwise.</em>
-<a name="988" href="#988">988</a> <em>     * @throws RepositoryException If an unspecified error occurs.</em>
-<a name="989" href="#989">989</a> <em>     */</em>
-<a name="990" href="#990">990</a>     <strong>public</strong> <strong>boolean</strong> hasNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name, <strong>int</strong> index) throws RepositoryException {
-<a name="991" href="#991">991</a>         <em class="comment">// check state of this instance</em>
-<a name="992" href="#992">992</a>         sanityCheck();
-<a name="993" href="#993">993</a> 
-<a name="994" href="#994">994</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> thisState = (NodeState) state;
-<a name="995" href="#995">995</a>         NodeState.ChildNodeEntry cne = thisState.getChildNodeEntry(name, index);
-<a name="996" href="#996">996</a>         <strong>if</strong> (cne == <strong>null</strong>) {
-<a name="997" href="#997">997</a>             <strong>return</strong> false;
-<a name="998" href="#998">998</a>         }
-<a name="999" href="#999">999</a>         <a href="../../../../org/apache/jackrabbit/core/NodeId.html">NodeId</a> nodeId = <strong>new</strong> <a href="../../../../org/apache/jackrabbit/core/NodeId.html">NodeId</a>(cne.getUUID());
-<a name="1000" href="#1000">1000</a> 
-<a name="1001" href="#1001">1001</a>         <strong>return</strong> itemMgr.itemExists(nodeId);
-<a name="1002" href="#1002">1002</a>     }
-<a name="1003" href="#1003">1003</a> 
-<a name="1004" href="#1004">1004</a>     <em>/**<em>*</em></em>
-<a name="1005" href="#1005">1005</a> <em>     * Returns the property of &lt;code>this&lt;/code> node with the specified</em>
-<a name="1006" href="#1006">1006</a> <em>     * &lt;code>name&lt;/code>.</em>
-<a name="1007" href="#1007">1007</a> <em>     *</em>
-<a name="1008" href="#1008">1008</a> <em>     * @param name The qualified name of the property to retrieve.</em>
-<a name="1009" href="#1009">1009</a> <em>     * @return The property with the specified &lt;code>name&lt;/code>.</em>
-<a name="1010" href="#1010">1010</a> <em>     * @throws ItemNotFoundException If no property exists with the</em>
-<a name="1011" href="#1011">1011</a> <em>     *                               specified name.</em>
-<a name="1012" href="#1012">1012</a> <em>     * @throws RepositoryException   If another error occurs.</em>
-<a name="1013" href="#1013">1013</a> <em>     */</em>
-<a name="1014" href="#1014">1014</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> getProperty(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name)
-<a name="1015" href="#1015">1015</a>             throws ItemNotFoundException, RepositoryException {
-<a name="1016" href="#1016">1016</a>         <em class="comment">// check state of this instance</em>
-<a name="1017" href="#1017">1017</a>         sanityCheck();
-<a name="1018" href="#1018">1018</a> 
-<a name="1019" href="#1019">1019</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> thisState = (NodeState) state;
-<a name="1020" href="#1020">1020</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyId.html">PropertyId</a> propId = <strong>new</strong> <a href="../../../../org/apache/jackrabbit/core/PropertyId.html">PropertyId</a>(thisState.getUUID(), name);
-<a name="1021" href="#1021">1021</a>         <strong>try</strong> {
-<a name="1022" href="#1022">1022</a>             <strong>return</strong> (PropertyImpl) itemMgr.getItem(propId);
-<a name="1023" href="#1023">1023</a>         } <strong>catch</strong> (AccessDeniedException ade) {
-<a name="1024" href="#1024">1024</a>             <strong>throw</strong> <strong>new</strong> ItemNotFoundException(name.toString());
-<a name="1025" href="#1025">1025</a>         }
-<a name="1026" href="#1026">1026</a>     }
-<a name="1027" href="#1027">1027</a> 
-<a name="1028" href="#1028">1028</a>     <em>/**<em>*</em></em>
-<a name="1029" href="#1029">1029</a> <em>     * Indicates whether a property with the specified &lt;code>name&lt;/code> exists.</em>
-<a name="1030" href="#1030">1030</a> <em>     * Returns &lt;code>true&lt;/code> if the property exists and &lt;code>false&lt;/code></em>
-<a name="1031" href="#1031">1031</a> <em>     * otherwise.</em>
-<a name="1032" href="#1032">1032</a> <em>     *</em>
-<a name="1033" href="#1033">1033</a> <em>     * @param name The qualified name of the property.</em>
-<a name="1034" href="#1034">1034</a> <em>     * @return &lt;code>true&lt;/code> if the property exists; &lt;code>false&lt;/code> otherwise.</em>
-<a name="1035" href="#1035">1035</a> <em>     * @throws RepositoryException If an unspecified error occurs.</em>
-<a name="1036" href="#1036">1036</a> <em>     */</em>
-<a name="1037" href="#1037">1037</a>     <strong>public</strong> <strong>boolean</strong> hasProperty(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name) throws RepositoryException {
-<a name="1038" href="#1038">1038</a>         <em class="comment">// check state of this instance</em>
-<a name="1039" href="#1039">1039</a>         sanityCheck();
-<a name="1040" href="#1040">1040</a> 
-<a name="1041" href="#1041">1041</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> thisState = (NodeState) state;
-<a name="1042" href="#1042">1042</a>         <strong>if</strong> (!thisState.hasPropertyEntry(name)) {
-<a name="1043" href="#1043">1043</a>             <strong>return</strong> false;
-<a name="1044" href="#1044">1044</a>         }
-<a name="1045" href="#1045">1045</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyId.html">PropertyId</a> propId = <strong>new</strong> <a href="../../../../org/apache/jackrabbit/core/PropertyId.html">PropertyId</a>(thisState.getUUID(), name);
-<a name="1046" href="#1046">1046</a> 
-<a name="1047" href="#1047">1047</a>         <strong>return</strong> itemMgr.itemExists(propId);
-<a name="1048" href="#1048">1048</a>     }
-<a name="1049" href="#1049">1049</a> 
-<a name="1050" href="#1050">1050</a>     <em>/**<em>*</em></em>
-<a name="1051" href="#1051">1051</a> <em>     * @see Node#addNode(String)</em>
-<a name="1052" href="#1052">1052</a> <em>     */</em>
-<a name="1053" href="#1053">1053</a>     <strong>public</strong> <strong>synchronized</strong> <a href="../../../../org/apache/jackrabbit/core/NodeImpl.html">NodeImpl</a> addNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> nodeName)
-<a name="1054" href="#1054">1054</a>             throws ItemExistsException, ConstraintViolationException,
-<a name="1055" href="#1055">1055</a>             RepositoryException {
-<a name="1056" href="#1056">1056</a>         <em class="comment">// check state of this instance</em>
-<a name="1057" href="#1057">1057</a>         sanityCheck();
-<a name="1058" href="#1058">1058</a> 
-<a name="1059" href="#1059">1059</a>         <strong>return</strong> internalAddChildNode(nodeName, <strong>null</strong>);
-<a name="1060" href="#1060">1060</a>     }
-<a name="1061" href="#1061">1061</a> 
-<a name="1062" href="#1062">1062</a>     <em>/**<em>*</em></em>
-<a name="1063" href="#1063">1063</a> <em>     * @see Node#addNode(String, String)</em>
-<a name="1064" href="#1064">1064</a> <em>     */</em>
-<a name="1065" href="#1065">1065</a>     <strong>public</strong> <strong>synchronized</strong> <a href="../../../../org/apache/jackrabbit/core/NodeImpl.html">NodeImpl</a> addNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> nodeName, <a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> nodeTypeName)
-<a name="1066" href="#1066">1066</a>             throws ItemExistsException, NoSuchNodeTypeException,
-<a name="1067" href="#1067">1067</a>             ConstraintViolationException, RepositoryException {
-<a name="1068" href="#1068">1068</a>         <em class="comment">// check state of this instance</em>
-<a name="1069" href="#1069">1069</a>         sanityCheck();
-<a name="1070" href="#1070">1070</a> 
-<a name="1071" href="#1071">1071</a>         <a href="../../../../org/apache/jackrabbit/core/nodetype/NodeTypeImpl.html">NodeTypeImpl</a> nt = session.getNodeTypeManager().getNodeType(nodeTypeName);
-<a name="1072" href="#1072">1072</a>         <strong>return</strong> internalAddChildNode(nodeName, nt);
-<a name="1073" href="#1073">1073</a>     }
-<a name="1074" href="#1074">1074</a> 
-<a name="1075" href="#1075">1075</a>     <em>/**<em>*</em></em>
-<a name="1076" href="#1076">1076</a> <em>     * Same as &lt;code>{@link Node#setProperty(String, String)}&lt;/code> except that</em>
-<a name="1077" href="#1077">1077</a> <em>     * this method takes a &lt;code>QName&lt;/code> instead of a &lt;code>String&lt;/code></em>
-<a name="1078" href="#1078">1078</a> <em>     * value.</em>
-<a name="1079" href="#1079">1079</a> <em>     *</em>
-<a name="1080" href="#1080">1080</a> <em>     * @param name</em>
-<a name="1081" href="#1081">1081</a> <em>     * @param value</em>
-<a name="1082" href="#1082">1082</a> <em>     * @return</em>
-<a name="1083" href="#1083">1083</a> <em>     * @throws ValueFormatException</em>
-<a name="1084" href="#1084">1084</a> <em>     * @throws RepositoryException</em>
-<a name="1085" href="#1085">1085</a> <em>     */</em>
-<a name="1086" href="#1086">1086</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> setProperty(String name, <a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> value) throws ValueFormatException, RepositoryException {
-<a name="1087" href="#1087">1087</a>         <em class="comment">// check state of this instance</em>
-<a name="1088" href="#1088">1088</a>         sanityCheck();
-<a name="1089" href="#1089">1089</a> 
-<a name="1090" href="#1090">1090</a>         BitSet status = <strong>new</strong> BitSet();
-<a name="1091" href="#1091">1091</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> prop = getOrCreateProperty(name, PropertyType.NAME, false, status);
-<a name="1092" href="#1092">1092</a>         <strong>try</strong> {
-<a name="1093" href="#1093">1093</a>             prop.setValue(value);
-<a name="1094" href="#1094">1094</a>         } <strong>catch</strong> (RepositoryException re) {
-<a name="1095" href="#1095">1095</a>             <strong>if</strong> (status.get(CREATED)) {
-<a name="1096" href="#1096">1096</a>                 <em class="comment">// setting value failed, get rid of newly created property</em>
-<a name="1097" href="#1097">1097</a>                 removeChildProperty(name);
-<a name="1098" href="#1098">1098</a>             }
-<a name="1099" href="#1099">1099</a>             <em class="comment">// rethrow</em>
-<a name="1100" href="#1100">1100</a>             <strong>throw</strong> re;
-<a name="1101" href="#1101">1101</a>         }
-<a name="1102" href="#1102">1102</a>         <strong>return</strong> prop;
-<a name="1103" href="#1103">1103</a>     }
-<a name="1104" href="#1104">1104</a> 
-<a name="1105" href="#1105">1105</a>     <em>/**<em>*</em></em>
-<a name="1106" href="#1106">1106</a> <em>     * Same as &lt;code>{@link Node#setProperty(String, String[])}&lt;/code> except that</em>
-<a name="1107" href="#1107">1107</a> <em>     * this method takes an array of  &lt;code>QName&lt;/code> instead of a</em>
-<a name="1108" href="#1108">1108</a> <em>     * &lt;code>String&lt;/code> values.</em>
-<a name="1109" href="#1109">1109</a> <em>     *</em>
-<a name="1110" href="#1110">1110</a> <em>     * @param name</em>
-<a name="1111" href="#1111">1111</a> <em>     * @param values</em>
-<a name="1112" href="#1112">1112</a> <em>     * @return</em>
-<a name="1113" href="#1113">1113</a> <em>     * @throws ValueFormatException</em>
-<a name="1114" href="#1114">1114</a> <em>     * @throws RepositoryException</em>
-<a name="1115" href="#1115">1115</a> <em>     */</em>
-<a name="1116" href="#1116">1116</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> setProperty(String name, <a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a>[] values) throws ValueFormatException, RepositoryException {
-<a name="1117" href="#1117">1117</a>         <em class="comment">// check state of this instance</em>
-<a name="1118" href="#1118">1118</a>         sanityCheck();
-<a name="1119" href="#1119">1119</a> 
-<a name="1120" href="#1120">1120</a>         BitSet status = <strong>new</strong> BitSet();
-<a name="1121" href="#1121">1121</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> prop = getOrCreateProperty(name, PropertyType.NAME, <strong>true</strong>, status);
-<a name="1122" href="#1122">1122</a>         <strong>try</strong> {
-<a name="1123" href="#1123">1123</a>             prop.setValue(values);
-<a name="1124" href="#1124">1124</a>         } <strong>catch</strong> (RepositoryException re) {
-<a name="1125" href="#1125">1125</a>             <strong>if</strong> (status.get(CREATED)) {
-<a name="1126" href="#1126">1126</a>                 <em class="comment">// setting value failed, get rid of newly created property</em>
-<a name="1127" href="#1127">1127</a>                 removeChildProperty(name);
-<a name="1128" href="#1128">1128</a>             }
-<a name="1129" href="#1129">1129</a>             <em class="comment">// rethrow</em>
-<a name="1130" href="#1130">1130</a>             <strong>throw</strong> re;
-<a name="1131" href="#1131">1131</a>         }
-<a name="1132" href="#1132">1132</a>         <strong>return</strong> prop;
-<a name="1133" href="#1133">1133</a>     }
-<a name="1134" href="#1134">1134</a> 
-<a name="1135" href="#1135">1135</a>     <em>/**<em>*</em></em>
-<a name="1136" href="#1136">1136</a> <em>     * Same as &lt;code>{@link Node#setProperty(String, Value[])}&lt;/code> except that</em>
-<a name="1137" href="#1137">1137</a> <em>     * this method takes a &lt;code>QName&lt;/code> name argument instead of a</em>
-<a name="1138" href="#1138">1138</a> <em>     * &lt;code>String&lt;/code>.</em>
-<a name="1139" href="#1139">1139</a> <em>     *</em>
-<a name="1140" href="#1140">1140</a> <em>     * @param name</em>
-<a name="1141" href="#1141">1141</a> <em>     * @param values</em>
-<a name="1142" href="#1142">1142</a> <em>     * @return</em>
-<a name="1143" href="#1143">1143</a> <em>     * @throws ValueFormatException</em>
-<a name="1144" href="#1144">1144</a> <em>     * @throws RepositoryException</em>
-<a name="1145" href="#1145">1145</a> <em>     */</em>
-<a name="1146" href="#1146">1146</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> setProperty(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name, Value[] values)
-<a name="1147" href="#1147">1147</a>             throws ValueFormatException, RepositoryException {
-<a name="1148" href="#1148">1148</a>         <em class="comment">// check state of this instance</em>
-<a name="1149" href="#1149">1149</a>         sanityCheck();
-<a name="1150" href="#1150">1150</a> 
-<a name="1151" href="#1151">1151</a>         <strong>int</strong> type;
-<a name="1152" href="#1152">1152</a>         <strong>if</strong> (values == <strong>null</strong> || values.length == 0) {
-<a name="1153" href="#1153">1153</a>             type = PropertyType.STRING;
-<a name="1154" href="#1154">1154</a>         } <strong>else</strong> {
-<a name="1155" href="#1155">1155</a>             type = values[0].getType();
-<a name="1156" href="#1156">1156</a>         }
-<a name="1157" href="#1157">1157</a>         BitSet status = <strong>new</strong> BitSet();
-<a name="1158" href="#1158">1158</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> prop = getOrCreateProperty(name, type, <strong>true</strong>, status);
-<a name="1159" href="#1159">1159</a>         <strong>try</strong> {
-<a name="1160" href="#1160">1160</a>             prop.setValue(values);
-<a name="1161" href="#1161">1161</a>         } <strong>catch</strong> (RepositoryException re) {
-<a name="1162" href="#1162">1162</a>             <strong>if</strong> (status.get(CREATED)) {
-<a name="1163" href="#1163">1163</a>                 <em class="comment">// setting value failed, get rid of newly created property</em>
-<a name="1164" href="#1164">1164</a>                 removeChildProperty(name);
-<a name="1165" href="#1165">1165</a>             }
-<a name="1166" href="#1166">1166</a>             <em class="comment">// rethrow</em>
-<a name="1167" href="#1167">1167</a>             <strong>throw</strong> re;
-<a name="1168" href="#1168">1168</a>         }
-<a name="1169" href="#1169">1169</a>         <strong>return</strong> prop;
-<a name="1170" href="#1170">1170</a>     }
-<a name="1171" href="#1171">1171</a> 
-<a name="1172" href="#1172">1172</a>     <em>/**<em>*</em></em>
-<a name="1173" href="#1173">1173</a> <em>     * Same as &lt;code>{@link Node#setProperty(String, Value)}&lt;/code> except that</em>
-<a name="1174" href="#1174">1174</a> <em>     * this method takes a &lt;code>QName&lt;/code> name argument instead of a</em>
-<a name="1175" href="#1175">1175</a> <em>     * &lt;code>String&lt;/code>.</em>
-<a name="1176" href="#1176">1176</a> <em>     *</em>
-<a name="1177" href="#1177">1177</a> <em>     * @param name</em>
-<a name="1178" href="#1178">1178</a> <em>     * @param value</em>
-<a name="1179" href="#1179">1179</a> <em>     * @return</em>
-<a name="1180" href="#1180">1180</a> <em>     * @throws ValueFormatException</em>
-<a name="1181" href="#1181">1181</a> <em>     * @throws RepositoryException</em>
-<a name="1182" href="#1182">1182</a> <em>     */</em>
-<a name="1183" href="#1183">1183</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> setProperty(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name, Value value)
-<a name="1184" href="#1184">1184</a>             throws ValueFormatException, RepositoryException {
-<a name="1185" href="#1185">1185</a>         <em class="comment">// check state of this instance</em>
-<a name="1186" href="#1186">1186</a>         sanityCheck();
-<a name="1187" href="#1187">1187</a> 
-<a name="1188" href="#1188">1188</a>         <strong>int</strong> type = (value == <strong>null</strong>) ? PropertyType.STRING : value.getType();
-<a name="1189" href="#1189">1189</a> 
-<a name="1190" href="#1190">1190</a>         BitSet status = <strong>new</strong> BitSet();
-<a name="1191" href="#1191">1191</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> prop = getOrCreateProperty(name, type, false, status);
-<a name="1192" href="#1192">1192</a>         <strong>try</strong> {
-<a name="1193" href="#1193">1193</a>             prop.setValue(value);
-<a name="1194" href="#1194">1194</a>         } <strong>catch</strong> (RepositoryException re) {
-<a name="1195" href="#1195">1195</a>             <strong>if</strong> (status.get(CREATED)) {
-<a name="1196" href="#1196">1196</a>                 <em class="comment">// setting value failed, get rid of newly created property</em>
-<a name="1197" href="#1197">1197</a>                 removeChildProperty(name);
-<a name="1198" href="#1198">1198</a>             }
-<a name="1199" href="#1199">1199</a>             <em class="comment">// rethrow</em>
-<a name="1200" href="#1200">1200</a>             <strong>throw</strong> re;
-<a name="1201" href="#1201">1201</a>         }
-<a name="1202" href="#1202">1202</a>         <strong>return</strong> prop;
-<a name="1203" href="#1203">1203</a>     }
-<a name="1204" href="#1204">1204</a> 
-<a name="1205" href="#1205">1205</a>     <em>/**<em>*</em></em>
-<a name="1206" href="#1206">1206</a> <em>     * @see ItemImpl#getQName()</em>
-<a name="1207" href="#1207">1207</a> <em>     */</em>
-<a name="1208" href="#1208">1208</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> getQName() throws RepositoryException {
-<a name="1209" href="#1209">1209</a>         <strong>return</strong> session.getHierarchyManager().getName(id);
-<a name="1210" href="#1210">1210</a>     }
-<a name="1211" href="#1211">1211</a> 
-<a name="1212" href="#1212">1212</a>     <em class="comment">//-----------------------------------------------------------------&lt; Item ></em>
-<a name="1213" href="#1213">1213</a>     <em>/**<em>*</em></em>
-<a name="1214" href="#1214">1214</a> <em>     * @see Item#isNode()</em>
-<a name="1215" href="#1215">1215</a> <em>     */</em>
-<a name="1216" href="#1216">1216</a>     <strong>public</strong> <strong>boolean</strong> isNode() {
-<a name="1217" href="#1217">1217</a>         <strong>return</strong> <strong>true</strong>;
-<a name="1218" href="#1218">1218</a>     }
-<a name="1219" href="#1219">1219</a> 
-<a name="1220" href="#1220">1220</a>     <em>/**<em>*</em></em>
-<a name="1221" href="#1221">1221</a> <em>     * @see Item#getName</em>
-<a name="1222" href="#1222">1222</a> <em>     */</em>
-<a name="1223" href="#1223">1223</a>     <strong>public</strong> String getName() throws RepositoryException {
-<a name="1224" href="#1224">1224</a>         <strong>if</strong> (state.getParentUUID() == <strong>null</strong>) {
-<a name="1225" href="#1225">1225</a>             <em class="comment">// this is the root node</em>
-<a name="1226" href="#1226">1226</a>             <strong>return</strong> <span class="string">""</span>;
-<a name="1227" href="#1227">1227</a>         }
-<a name="1228" href="#1228">1228</a> 
-<a name="1229" href="#1229">1229</a>         <em class="comment">//QName name = getPrimaryPath().getNameElement().getName();</em>
-<a name="1230" href="#1230">1230</a>         <a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name = session.getHierarchyManager().getName(id);
-<a name="1231" href="#1231">1231</a>         <strong>try</strong> {
-<a name="1232" href="#1232">1232</a>             <strong>return</strong> name.toJCRName(session.getNamespaceResolver());
-<a name="1233" href="#1233">1233</a>         } <strong>catch</strong> (NoPrefixDeclaredException npde) {
-<a name="1234" href="#1234">1234</a>             <em class="comment">// should never get here...</em>
-<a name="1235" href="#1235">1235</a>             String msg = <span class="string">"internal error: encountered unregistered namespace "</span> + name.getNamespaceURI();
-<a name="1236" href="#1236">1236</a>             log.error(msg, npde);
-<a name="1237" href="#1237">1237</a>             <strong>throw</strong> <strong>new</strong> RepositoryException(msg, npde);
-<a name="1238" href="#1238">1238</a>         }
-<a name="1239" href="#1239">1239</a>     }
-<a name="1240" href="#1240">1240</a> 
-<a name="1241" href="#1241">1241</a>     <em>/**<em>*</em></em>
-<a name="1242" href="#1242">1242</a> <em>     * @see Item#accept(ItemVisitor)</em>
-<a name="1243" href="#1243">1243</a> <em>     */</em>
-<a name="1244" href="#1244">1244</a>     <strong>public</strong> <strong>void</strong> accept(ItemVisitor visitor) throws RepositoryException {
-<a name="1245" href="#1245">1245</a>         <em class="comment">// check state of this instance</em>
-<a name="1246" href="#1246">1246</a>         sanityCheck();
-<a name="1247" href="#1247">1247</a> 
-<a name="1248" href="#1248">1248</a>         visitor.visit(<strong>this</strong>);
-<a name="1249" href="#1249">1249</a>     }
-<a name="1250" href="#1250">1250</a> 
-<a name="1251" href="#1251">1251</a>     <em>/**<em>*</em></em>
-<a name="1252" href="#1252">1252</a> <em>     * @see Item#getParent</em>
-<a name="1253" href="#1253">1253</a> <em>     */</em>
-<a name="1254" href="#1254">1254</a>     <strong>public</strong> Node getParent()
-<a name="1255" href="#1255">1255</a>             throws ItemNotFoundException, AccessDeniedException, RepositoryException {
-<a name="1256" href="#1256">1256</a>         <em class="comment">// check state of this instance</em>
-<a name="1257" href="#1257">1257</a>         sanityCheck();
-<a name="1258" href="#1258">1258</a> 
-<a name="1259" href="#1259">1259</a>         <em class="comment">// check if root node</em>
-<a name="1260" href="#1260">1260</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> thisState = (NodeState) state;
-<a name="1261" href="#1261">1261</a>         <strong>if</strong> (thisState.getParentUUID() == <strong>null</strong>) {
-<a name="1262" href="#1262">1262</a>             String msg = <span class="string">"root node doesn't have a parent"</span>;
-<a name="1263" href="#1263">1263</a>             log.error(msg);
-<a name="1264" href="#1264">1264</a>             <strong>throw</strong> <strong>new</strong> ItemNotFoundException(msg);
-<a name="1265" href="#1265">1265</a>         }
-<a name="1266" href="#1266">1266</a> 
-<a name="1267" href="#1267">1267</a>         <a href="../../../../org/apache/jackrabbit/core/Path.html">Path</a> path = getPrimaryPath();
-<a name="1268" href="#1268">1268</a>         <strong>return</strong> (Node) getAncestor(path.getAncestorCount() - 1);
-<a name="1269" href="#1269">1269</a>     }
-<a name="1270" href="#1270">1270</a> 
-<a name="1271" href="#1271">1271</a>     <em class="comment">//-----------------------------------------------------------------&lt; Node ></em>
-<a name="1272" href="#1272">1272</a>     <em>/**<em>*</em></em>
-<a name="1273" href="#1273">1273</a> <em>     * @see Node#addNode(String)</em>
-<a name="1274" href="#1274">1274</a> <em>     */</em>
-<a name="1275" href="#1275">1275</a>     <strong>public</strong> <strong>synchronized</strong> Node addNode(String relPath)
-<a name="1276" href="#1276">1276</a>             throws ItemExistsException, PathNotFoundException, VersionException,
-<a name="1277" href="#1277">1277</a>             ConstraintViolationException, LockException, RepositoryException {
-<a name="1278" href="#1278">1278</a>         <em class="comment">// check state of this instance</em>
-<a name="1279" href="#1279">1279</a>         sanityCheck();
-<a name="1280" href="#1280">1280</a> 
-<a name="1281" href="#1281">1281</a>         <em class="comment">// check if versioning allows write (only cheap call)</em>
-<a name="1282" href="#1282">1282</a>         <strong>if</strong> (!isCheckedOut(false)) {
-<a name="1283" href="#1283">1283</a>             String msg = safeGetJCRPath() + <span class="string">": cannot add a child to a checked-in node"</span>;
-<a name="1284" href="#1284">1284</a>             log.error(msg);
-<a name="1285" href="#1285">1285</a>             <strong>throw</strong> <strong>new</strong> VersionException(msg);
-<a name="1286" href="#1286">1286</a>         }
-<a name="1287" href="#1287">1287</a> 
-<a name="1288" href="#1288">1288</a>         <strong>return</strong> internalAddNode(relPath, <strong>null</strong>);
-<a name="1289" href="#1289">1289</a>     }
-<a name="1290" href="#1290">1290</a> 
-<a name="1291" href="#1291">1291</a>     <em>/**<em>*</em></em>
-<a name="1292" href="#1292">1292</a> <em>     * @see Node#addNode(String, String)</em>
-<a name="1293" href="#1293">1293</a> <em>     */</em>
-<a name="1294" href="#1294">1294</a>     <strong>public</strong> <strong>synchronized</strong> Node addNode(String relPath, String nodeTypeName)
-<a name="1295" href="#1295">1295</a>             throws ItemExistsException, PathNotFoundException,
-<a name="1296" href="#1296">1296</a>             NoSuchNodeTypeException, VersionException,
-<a name="1297" href="#1297">1297</a>             ConstraintViolationException, LockException, RepositoryException {
-<a name="1298" href="#1298">1298</a>         <em class="comment">// check state of this instance</em>
-<a name="1299" href="#1299">1299</a>         sanityCheck();
-<a name="1300" href="#1300">1300</a> 
-<a name="1301" href="#1301">1301</a>         <em class="comment">// check if versioning allows write (only cheap call)</em>
-<a name="1302" href="#1302">1302</a>         <strong>if</strong> (!isCheckedOut(false)) {
-<a name="1303" href="#1303">1303</a>             String msg = safeGetJCRPath() + <span class="string">": cannot add a child to a checked-in node"</span>;
-<a name="1304" href="#1304">1304</a>             log.error(msg);
-<a name="1305" href="#1305">1305</a>             <strong>throw</strong> <strong>new</strong> VersionException(msg);
-<a name="1306" href="#1306">1306</a>         }
-<a name="1307" href="#1307">1307</a> 
-<a name="1308" href="#1308">1308</a>         <a href="../../../../org/apache/jackrabbit/core/nodetype/NodeTypeImpl.html">NodeTypeImpl</a> nt = (NodeTypeImpl) session.getNodeTypeManager().getNodeType(nodeTypeName);
-<a name="1309" href="#1309">1309</a>         <strong>return</strong> internalAddNode(relPath, nt);
-<a name="1310" href="#1310">1310</a>     }
-<a name="1311" href="#1311">1311</a> 
-<a name="1312" href="#1312">1312</a>     <em>/**<em>*</em></em>
-<a name="1313" href="#1313">1313</a> <em>     * @see Node#orderBefore(String, String)</em>
-<a name="1314" href="#1314">1314</a> <em>     */</em>
-<a name="1315" href="#1315">1315</a>     <strong>public</strong> <strong>synchronized</strong> <strong>void</strong> orderBefore(String srcName, String destName)
-<a name="1316" href="#1316">1316</a>             throws UnsupportedRepositoryOperationException, VersionException,
-<a name="1317" href="#1317">1317</a>             ConstraintViolationException, ItemNotFoundException, LockException,
-<a name="1318" href="#1318">1318</a>             RepositoryException {
-<a name="1319" href="#1319">1319</a> 
-<a name="1320" href="#1320">1320</a>         <strong>if</strong> (!nodeType.hasOrderableChildNodes()) {
-<a name="1321" href="#1321">1321</a>             <strong>throw</strong> <strong>new</strong> UnsupportedRepositoryOperationException(<span class="string">"child node ordering not supported on node "</span> + safeGetJCRPath());
-<a name="1322" href="#1322">1322</a>         }
-<a name="1323" href="#1323">1323</a> 
-<a name="1324" href="#1324">1324</a>         <em class="comment">// check arguments</em>
-<a name="1325" href="#1325">1325</a>         <strong>if</strong> (srcName.equals(destName)) {
-<a name="1326" href="#1326">1326</a>             <strong>throw</strong> <strong>new</strong> ConstraintViolationException(<span class="string">"source and destination have to be different"</span>);
-<a name="1327" href="#1327">1327</a>         }
-<a name="1328" href="#1328">1328</a> 
-<a name="1329" href="#1329">1329</a>         Path.PathElement insertName;
-<a name="1330" href="#1330">1330</a>         <strong>try</strong> {
-<a name="1331" href="#1331">1331</a>             <a href="../../../../org/apache/jackrabbit/core/Path.html">Path</a> p = Path.create(srcName, session.getNamespaceResolver(), false);
-<a name="1332" href="#1332">1332</a>             <em class="comment">// p must be a relative path of length==depth==1 (to eliminate e.g. "..")</em>
-<a name="1333" href="#1333">1333</a>             <strong>if</strong> (p.isAbsolute() || p.getLength() != 1 || p.getDepth() != 1) {
-<a name="1334" href="#1334">1334</a>                 <strong>throw</strong> <strong>new</strong> RepositoryException(<span class="string">"invalid name: "</span> + srcName);
-<a name="1335" href="#1335">1335</a>             }
-<a name="1336" href="#1336">1336</a>             insertName = p.getNameElement();
-<a name="1337" href="#1337">1337</a>         } <strong>catch</strong> (MalformedPathException e) {
-<a name="1338" href="#1338">1338</a>             String msg = <span class="string">"invalid name: "</span> + srcName;
-<a name="1339" href="#1339">1339</a>             log.error(msg, e);
-<a name="1340" href="#1340">1340</a>             <strong>throw</strong> <strong>new</strong> RepositoryException(msg, e);
+<a name="833" href="#833">833</a> <em>     * Same as {@link Node#isNodeType(String)}, but takes a &lt;code>QName&lt;/code></em>
+<a name="834" href="#834">834</a> <em>     * instad of a &lt;code>String&lt;/code>.</em>
+<a name="835" href="#835">835</a> <em>     * @param ntName name of node type</em>
+<a name="836" href="#836">836</a> <em>     * @return &lt;code>true&lt;/code> if this node is of the specified node type;</em>
+<a name="837" href="#837">837</a> <em>     *         otherwise &lt;code>false&lt;/code></em>
+<a name="838" href="#838">838</a> <em>     */</em>
+<a name="839" href="#839">839</a>     <strong>public</strong> <strong>boolean</strong> isNodeType(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> ntName) throws RepositoryException {
+<a name="840" href="#840">840</a>         <em class="comment">// no need to perform sanity check; assume this has</em>
+<a name="841" href="#841">841</a>         <em class="comment">// already been done by calling method</em>
+<a name="842" href="#842">842</a> 
+<a name="843" href="#843">843</a>         <strong>if</strong> (ntName.equals(nodeType.getQName())) {
+<a name="844" href="#844">844</a>             <strong>return</strong> <strong>true</strong>;
+<a name="845" href="#845">845</a>         }
+<a name="846" href="#846">846</a> 
+<a name="847" href="#847">847</a>         <strong>if</strong> (nodeType.isDerivedFrom(ntName)) {
+<a name="848" href="#848">848</a>             <strong>return</strong> <strong>true</strong>;
+<a name="849" href="#849">849</a>         }
+<a name="850" href="#850">850</a> 
+<a name="851" href="#851">851</a>         <em class="comment">// check mixin types</em>
+<a name="852" href="#852">852</a>         Set mixinNames = ((NodeState) state).getMixinTypeNames();
+<a name="853" href="#853">853</a>         <strong>if</strong> (mixinNames.isEmpty()) {
+<a name="854" href="#854">854</a>             <strong>return</strong> false;
+<a name="855" href="#855">855</a>         }
+<a name="856" href="#856">856</a>         <a href="../../../../org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.html">NodeTypeRegistry</a> ntReg = session.getNodeTypeManager().getNodeTypeRegistry();
+<a name="857" href="#857">857</a>         <strong>try</strong> {
+<a name="858" href="#858">858</a>             <a href="../../../../org/apache/jackrabbit/core/nodetype/EffectiveNodeType.html">EffectiveNodeType</a> ent = ntReg.getEffectiveNodeType((QName[]) mixinNames.toArray(<strong>new</strong> QName[mixinNames.size()]));
+<a name="859" href="#859">859</a>             <strong>return</strong> ent.includesNodeType(ntName);
+<a name="860" href="#860">860</a>         } <strong>catch</strong> (NodeTypeConflictException ntce) {
+<a name="861" href="#861">861</a>             String msg = <span class="string">"internal error: invalid mixin node type(s)"</span>;
+<a name="862" href="#862">862</a>             log.error(msg, ntce);
+<a name="863" href="#863">863</a>             <strong>throw</strong> <strong>new</strong> RepositoryException(msg, ntce);
+<a name="864" href="#864">864</a>         }
+<a name="865" href="#865">865</a>     }
+<a name="866" href="#866">866</a> 
+<a name="867" href="#867">867</a>     <em>/**<em>*</em></em>
+<a name="868" href="#868">868</a> <em>     * Returns the (internal) uuid of this node.</em>
+<a name="869" href="#869">869</a> <em>     * @return the uuid of this node</em>
+<a name="870" href="#870">870</a> <em>     */</em>
+<a name="871" href="#871">871</a>     <strong>public</strong> String internalGetUUID() {
+<a name="872" href="#872">872</a>         <strong>return</strong> ((NodeState) state).getUUID();
+<a name="873" href="#873">873</a>     }
+<a name="874" href="#874">874</a> 
+<a name="875" href="#875">875</a>     <em>/**<em>*</em></em>
+<a name="876" href="#876">876</a> <em>     * Sets the internal value of a property without checking any constraints.</em>
+<a name="877" href="#877">877</a> <em>     * &lt;p/></em>
+<a name="878" href="#878">878</a> <em>     * Note that no type conversion is being performed, i.e. it's the caller's</em>
+<a name="879" href="#879">879</a> <em>     * responsibility to make sure that the type of the given value is compatible</em>
+<a name="880" href="#880">880</a> <em>     * with the specified property's definition.</em>
+<a name="881" href="#881">881</a> <em>     *</em>
+<a name="882" href="#882">882</a> <em>     * @param name</em>
+<a name="883" href="#883">883</a> <em>     * @param value</em>
+<a name="884" href="#884">884</a> <em>     * @return</em>
+<a name="885" href="#885">885</a> <em>     * @throws ValueFormatException</em>
+<a name="886" href="#886">886</a> <em>     * @throws RepositoryException</em>
+<a name="887" href="#887">887</a> <em>     */</em>
+<a name="888" href="#888">888</a>     <strong>public</strong> Property internalSetProperty(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name, <a href="../../../../org/apache/jackrabbit/core/InternalValue.html">InternalValue</a> value)
+<a name="889" href="#889">889</a>             throws ValueFormatException, RepositoryException {
+<a name="890" href="#890">890</a>         <em class="comment">// check state of this instance</em>
+<a name="891" href="#891">891</a>         sanityCheck();
+<a name="892" href="#892">892</a> 
+<a name="893" href="#893">893</a>         <strong>int</strong> type;
+<a name="894" href="#894">894</a>         <strong>if</strong> (value == <strong>null</strong>) {
+<a name="895" href="#895">895</a>             type = PropertyType.STRING;
+<a name="896" href="#896">896</a>         } <strong>else</strong> {
+<a name="897" href="#897">897</a>             type = value.getType();
+<a name="898" href="#898">898</a>         }
+<a name="899" href="#899">899</a> 
+<a name="900" href="#900">900</a>         BitSet status = <strong>new</strong> BitSet();
+<a name="901" href="#901">901</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> prop = getOrCreateProperty(name, type, false, status);
+<a name="902" href="#902">902</a>         <strong>try</strong> {
+<a name="903" href="#903">903</a>             <strong>if</strong> (value == <strong>null</strong>) {
+<a name="904" href="#904">904</a>                 prop.internalSetValue(<strong>null</strong>, type);
+<a name="905" href="#905">905</a>             } <strong>else</strong> {
+<a name="906" href="#906">906</a>                 prop.internalSetValue(<strong>new</strong> <a href="../../../../org/apache/jackrabbit/core/InternalValue.html">InternalValue</a>[]{value}, type);
+<a name="907" href="#907">907</a>             }
+<a name="908" href="#908">908</a>         } <strong>catch</strong> (RepositoryException re) {
+<a name="909" href="#909">909</a>             <strong>if</strong> (status.get(CREATED)) {
+<a name="910" href="#910">910</a>                 <em class="comment">// setting value failed, get rid of newly created property</em>
+<a name="911" href="#911">911</a>                 removeChildProperty(name);
+<a name="912" href="#912">912</a>             }
+<a name="913" href="#913">913</a>             <em class="comment">// rethrow</em>
+<a name="914" href="#914">914</a>             <strong>throw</strong> re;
+<a name="915" href="#915">915</a>         }
+<a name="916" href="#916">916</a>         <strong>return</strong> prop;
+<a name="917" href="#917">917</a>     }
+<a name="918" href="#918">918</a> 
+<a name="919" href="#919">919</a>     <em>/**<em>*</em></em>
+<a name="920" href="#920">920</a> <em>     * Sets the internal value of a property without checking any constraints.</em>
+<a name="921" href="#921">921</a> <em>     * &lt;p/></em>
+<a name="922" href="#922">922</a> <em>     * Note that no type conversion is being performed, i.e. it's the caller's</em>
+<a name="923" href="#923">923</a> <em>     * responsibility to make sure that the type of the given values is compatible</em>
+<a name="924" href="#924">924</a> <em>     * with the specified property's definition.</em>
+<a name="925" href="#925">925</a> <em>     *</em>
+<a name="926" href="#926">926</a> <em>     * @param name</em>
+<a name="927" href="#927">927</a> <em>     * @param values</em>
+<a name="928" href="#928">928</a> <em>     * @return</em>
+<a name="929" href="#929">929</a> <em>     * @throws ValueFormatException</em>
+<a name="930" href="#930">930</a> <em>     * @throws RepositoryException</em>
+<a name="931" href="#931">931</a> <em>     */</em>
+<a name="932" href="#932">932</a>     <strong>protected</strong> Property internalSetProperty(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name, <a href="../../../../org/apache/jackrabbit/core/InternalValue.html">InternalValue</a>[] values)
+<a name="933" href="#933">933</a>             throws ValueFormatException, RepositoryException {
+<a name="934" href="#934">934</a>         <em class="comment">// check state of this instance</em>
+<a name="935" href="#935">935</a>         sanityCheck();
+<a name="936" href="#936">936</a> 
+<a name="937" href="#937">937</a>         <strong>int</strong> type;
+<a name="938" href="#938">938</a>         <strong>if</strong> (values == <strong>null</strong> || values.length == 0) {
+<a name="939" href="#939">939</a>             type = PropertyType.STRING;
+<a name="940" href="#940">940</a>         } <strong>else</strong> {
+<a name="941" href="#941">941</a>             type = values[0].getType();
+<a name="942" href="#942">942</a>         }
+<a name="943" href="#943">943</a> 
+<a name="944" href="#944">944</a>         BitSet status = <strong>new</strong> BitSet();
+<a name="945" href="#945">945</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> prop = getOrCreateProperty(name, type, <strong>true</strong>, status);
+<a name="946" href="#946">946</a>         <strong>try</strong> {
+<a name="947" href="#947">947</a>             prop.internalSetValue(values, type);
+<a name="948" href="#948">948</a>         } <strong>catch</strong> (RepositoryException re) {
+<a name="949" href="#949">949</a>             <strong>if</strong> (status.get(CREATED)) {
+<a name="950" href="#950">950</a>                 <em class="comment">// setting value failed, get rid of newly created property</em>
+<a name="951" href="#951">951</a>                 removeChildProperty(name);
+<a name="952" href="#952">952</a>             }
+<a name="953" href="#953">953</a>             <em class="comment">// rethrow</em>
+<a name="954" href="#954">954</a>             <strong>throw</strong> re;
+<a name="955" href="#955">955</a>         }
+<a name="956" href="#956">956</a>         <strong>return</strong> prop;
+<a name="957" href="#957">957</a>     }
+<a name="958" href="#958">958</a> 
+<a name="959" href="#959">959</a>     <em>/**<em>*</em></em>
+<a name="960" href="#960">960</a> <em>     * Returns the child node of &lt;code>this&lt;/code> node with the specified</em>
+<a name="961" href="#961">961</a> <em>     * &lt;code>name&lt;/code>.</em>
+<a name="962" href="#962">962</a> <em>     *</em>
+<a name="963" href="#963">963</a> <em>     * @param name The qualified name of the child node to retrieve.</em>
+<a name="964" href="#964">964</a> <em>     * @return The child node with the specified &lt;code>name&lt;/code>.</em>
+<a name="965" href="#965">965</a> <em>     * @throws ItemNotFoundException If no child node exists with the</em>
+<a name="966" href="#966">966</a> <em>     *                               specified name.</em>
+<a name="967" href="#967">967</a> <em>     * @throws RepositoryException   If another error occurs.</em>
+<a name="968" href="#968">968</a> <em>     */</em>
+<a name="969" href="#969">969</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/NodeImpl.html">NodeImpl</a> getNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name) throws ItemNotFoundException, RepositoryException {
+<a name="970" href="#970">970</a>         <strong>return</strong> getNode(name, 1);
+<a name="971" href="#971">971</a>     }
+<a name="972" href="#972">972</a> 
+<a name="973" href="#973">973</a>     <em>/**<em>*</em></em>
+<a name="974" href="#974">974</a> <em>     * Returns the child node of &lt;code>this&lt;/code> node with the specified</em>
+<a name="975" href="#975">975</a> <em>     * &lt;code>name&lt;/code>.</em>
+<a name="976" href="#976">976</a> <em>     *</em>
+<a name="977" href="#977">977</a> <em>     * @param name  The qualified name of the child node to retrieve.</em>
+<a name="978" href="#978">978</a> <em>     * @param index The index of the child node to retrieve (in the case of same-name siblings).</em>
+<a name="979" href="#979">979</a> <em>     * @return The child node with the specified &lt;code>name&lt;/code>.</em>
+<a name="980" href="#980">980</a> <em>     * @throws ItemNotFoundException If no child node exists with the</em>
+<a name="981" href="#981">981</a> <em>     *                               specified name.</em>
+<a name="982" href="#982">982</a> <em>     * @throws RepositoryException   If another error occurs.</em>
+<a name="983" href="#983">983</a> <em>     */</em>
+<a name="984" href="#984">984</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/NodeImpl.html">NodeImpl</a> getNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name, <strong>int</strong> index)
+<a name="985" href="#985">985</a>             throws ItemNotFoundException, RepositoryException {
+<a name="986" href="#986">986</a>         <em class="comment">// check state of this instance</em>
+<a name="987" href="#987">987</a>         sanityCheck();
+<a name="988" href="#988">988</a> 
+<a name="989" href="#989">989</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> thisState = (NodeState) state;
+<a name="990" href="#990">990</a>         NodeState.ChildNodeEntry cne = thisState.getChildNodeEntry(name, index);
+<a name="991" href="#991">991</a>         <strong>if</strong> (cne == <strong>null</strong>) {
+<a name="992" href="#992">992</a>             <strong>throw</strong> <strong>new</strong> ItemNotFoundException();
+<a name="993" href="#993">993</a>         }
+<a name="994" href="#994">994</a>         <a href="../../../../org/apache/jackrabbit/core/NodeId.html">NodeId</a> nodeId = <strong>new</strong> <a href="../../../../org/apache/jackrabbit/core/NodeId.html">NodeId</a>(cne.getUUID());
+<a name="995" href="#995">995</a>         <strong>try</strong> {
+<a name="996" href="#996">996</a>             <strong>return</strong> (NodeImpl) itemMgr.getItem(nodeId);
+<a name="997" href="#997">997</a>         } <strong>catch</strong> (AccessDeniedException ade) {
+<a name="998" href="#998">998</a>             <strong>throw</strong> <strong>new</strong> ItemNotFoundException();
+<a name="999" href="#999">999</a>         }
+<a name="1000" href="#1000">1000</a>     }
+<a name="1001" href="#1001">1001</a> 
+<a name="1002" href="#1002">1002</a>     <em>/**<em>*</em></em>
+<a name="1003" href="#1003">1003</a> <em>     * Indicates whether a child node with the specified &lt;code>name&lt;/code> exists.</em>
+<a name="1004" href="#1004">1004</a> <em>     * Returns &lt;code>true&lt;/code> if the child node exists and &lt;code>false&lt;/code></em>
+<a name="1005" href="#1005">1005</a> <em>     * otherwise.</em>
+<a name="1006" href="#1006">1006</a> <em>     *</em>
+<a name="1007" href="#1007">1007</a> <em>     * @param name The qualified name of the child node.</em>
+<a name="1008" href="#1008">1008</a> <em>     * @return &lt;code>true&lt;/code> if the child node exists; &lt;code>false&lt;/code> otherwise.</em>
+<a name="1009" href="#1009">1009</a> <em>     * @throws RepositoryException If an unspecified error occurs.</em>
+<a name="1010" href="#1010">1010</a> <em>     */</em>
+<a name="1011" href="#1011">1011</a>     <strong>public</strong> <strong>boolean</strong> hasNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name) throws RepositoryException {
+<a name="1012" href="#1012">1012</a>         <strong>return</strong> hasNode(name, 1);
+<a name="1013" href="#1013">1013</a>     }
+<a name="1014" href="#1014">1014</a> 
+<a name="1015" href="#1015">1015</a>     <em>/**<em>*</em></em>
+<a name="1016" href="#1016">1016</a> <em>     * Indicates whether a child node with the specified &lt;code>name&lt;/code> exists.</em>
+<a name="1017" href="#1017">1017</a> <em>     * Returns &lt;code>true&lt;/code> if the child node exists and &lt;code>false&lt;/code></em>
+<a name="1018" href="#1018">1018</a> <em>     * otherwise.</em>
+<a name="1019" href="#1019">1019</a> <em>     *</em>
+<a name="1020" href="#1020">1020</a> <em>     * @param name  The qualified name of the child node.</em>
+<a name="1021" href="#1021">1021</a> <em>     * @param index The index of the child node (in the case of same-name siblings).</em>
+<a name="1022" href="#1022">1022</a> <em>     * @return &lt;code>true&lt;/code> if the child node exists; &lt;code>false&lt;/code> otherwise.</em>
+<a name="1023" href="#1023">1023</a> <em>     * @throws RepositoryException If an unspecified error occurs.</em>
+<a name="1024" href="#1024">1024</a> <em>     */</em>
+<a name="1025" href="#1025">1025</a>     <strong>public</strong> <strong>boolean</strong> hasNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name, <strong>int</strong> index) throws RepositoryException {
+<a name="1026" href="#1026">1026</a>         <em class="comment">// check state of this instance</em>
+<a name="1027" href="#1027">1027</a>         sanityCheck();
+<a name="1028" href="#1028">1028</a> 
+<a name="1029" href="#1029">1029</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> thisState = (NodeState) state;
+<a name="1030" href="#1030">1030</a>         NodeState.ChildNodeEntry cne = thisState.getChildNodeEntry(name, index);
+<a name="1031" href="#1031">1031</a>         <strong>if</strong> (cne == <strong>null</strong>) {
+<a name="1032" href="#1032">1032</a>             <strong>return</strong> false;
+<a name="1033" href="#1033">1033</a>         }
+<a name="1034" href="#1034">1034</a>         <a href="../../../../org/apache/jackrabbit/core/NodeId.html">NodeId</a> nodeId = <strong>new</strong> <a href="../../../../org/apache/jackrabbit/core/NodeId.html">NodeId</a>(cne.getUUID());
+<a name="1035" href="#1035">1035</a> 
+<a name="1036" href="#1036">1036</a>         <strong>return</strong> itemMgr.itemExists(nodeId);
+<a name="1037" href="#1037">1037</a>     }
+<a name="1038" href="#1038">1038</a> 
+<a name="1039" href="#1039">1039</a>     <em>/**<em>*</em></em>
+<a name="1040" href="#1040">1040</a> <em>     * Returns the property of &lt;code>this&lt;/code> node with the specified</em>
+<a name="1041" href="#1041">1041</a> <em>     * &lt;code>name&lt;/code>.</em>
+<a name="1042" href="#1042">1042</a> <em>     *</em>
+<a name="1043" href="#1043">1043</a> <em>     * @param name The qualified name of the property to retrieve.</em>
+<a name="1044" href="#1044">1044</a> <em>     * @return The property with the specified &lt;code>name&lt;/code>.</em>
+<a name="1045" href="#1045">1045</a> <em>     * @throws ItemNotFoundException If no property exists with the</em>
+<a name="1046" href="#1046">1046</a> <em>     *                               specified name.</em>
+<a name="1047" href="#1047">1047</a> <em>     * @throws RepositoryException   If another error occurs.</em>
+<a name="1048" href="#1048">1048</a> <em>     */</em>
+<a name="1049" href="#1049">1049</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> getProperty(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name)
+<a name="1050" href="#1050">1050</a>             throws ItemNotFoundException, RepositoryException {
+<a name="1051" href="#1051">1051</a>         <em class="comment">// check state of this instance</em>
+<a name="1052" href="#1052">1052</a>         sanityCheck();
+<a name="1053" href="#1053">1053</a> 
+<a name="1054" href="#1054">1054</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> thisState = (NodeState) state;
+<a name="1055" href="#1055">1055</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyId.html">PropertyId</a> propId = <strong>new</strong> <a href="../../../../org/apache/jackrabbit/core/PropertyId.html">PropertyId</a>(thisState.getUUID(), name);
+<a name="1056" href="#1056">1056</a>         <strong>try</strong> {
+<a name="1057" href="#1057">1057</a>             <strong>return</strong> (PropertyImpl) itemMgr.getItem(propId);
+<a name="1058" href="#1058">1058</a>         } <strong>catch</strong> (AccessDeniedException ade) {
+<a name="1059" href="#1059">1059</a>             <strong>throw</strong> <strong>new</strong> ItemNotFoundException(name.toString());
+<a name="1060" href="#1060">1060</a>         }
+<a name="1061" href="#1061">1061</a>     }
+<a name="1062" href="#1062">1062</a> 
+<a name="1063" href="#1063">1063</a>     <em>/**<em>*</em></em>
+<a name="1064" href="#1064">1064</a> <em>     * Indicates whether a property with the specified &lt;code>name&lt;/code> exists.</em>
+<a name="1065" href="#1065">1065</a> <em>     * Returns &lt;code>true&lt;/code> if the property exists and &lt;code>false&lt;/code></em>
+<a name="1066" href="#1066">1066</a> <em>     * otherwise.</em>
+<a name="1067" href="#1067">1067</a> <em>     *</em>
+<a name="1068" href="#1068">1068</a> <em>     * @param name The qualified name of the property.</em>
+<a name="1069" href="#1069">1069</a> <em>     * @return &lt;code>true&lt;/code> if the property exists; &lt;code>false&lt;/code> otherwise.</em>
+<a name="1070" href="#1070">1070</a> <em>     * @throws RepositoryException If an unspecified error occurs.</em>
+<a name="1071" href="#1071">1071</a> <em>     */</em>
+<a name="1072" href="#1072">1072</a>     <strong>public</strong> <strong>boolean</strong> hasProperty(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name) throws RepositoryException {
+<a name="1073" href="#1073">1073</a>         <em class="comment">// check state of this instance</em>
+<a name="1074" href="#1074">1074</a>         sanityCheck();
+<a name="1075" href="#1075">1075</a> 
+<a name="1076" href="#1076">1076</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> thisState = (NodeState) state;
+<a name="1077" href="#1077">1077</a>         <strong>if</strong> (!thisState.hasPropertyEntry(name)) {
+<a name="1078" href="#1078">1078</a>             <strong>return</strong> false;
+<a name="1079" href="#1079">1079</a>         }
+<a name="1080" href="#1080">1080</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyId.html">PropertyId</a> propId = <strong>new</strong> <a href="../../../../org/apache/jackrabbit/core/PropertyId.html">PropertyId</a>(thisState.getUUID(), name);
+<a name="1081" href="#1081">1081</a> 
+<a name="1082" href="#1082">1082</a>         <strong>return</strong> itemMgr.itemExists(propId);
+<a name="1083" href="#1083">1083</a>     }
+<a name="1084" href="#1084">1084</a> 
+<a name="1085" href="#1085">1085</a>     <em>/**<em>*</em></em>
+<a name="1086" href="#1086">1086</a> <em>     * @see Node#addNode(String)</em>
+<a name="1087" href="#1087">1087</a> <em>     */</em>
+<a name="1088" href="#1088">1088</a>     <strong>public</strong> <strong>synchronized</strong> <a href="../../../../org/apache/jackrabbit/core/NodeImpl.html">NodeImpl</a> addNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> nodeName)
+<a name="1089" href="#1089">1089</a>             throws ItemExistsException, ConstraintViolationException,
+<a name="1090" href="#1090">1090</a>             RepositoryException {
+<a name="1091" href="#1091">1091</a>         <em class="comment">// check state of this instance</em>
+<a name="1092" href="#1092">1092</a>         sanityCheck();
+<a name="1093" href="#1093">1093</a> 
+<a name="1094" href="#1094">1094</a>         <strong>return</strong> internalAddChildNode(nodeName, <strong>null</strong>);
+<a name="1095" href="#1095">1095</a>     }
+<a name="1096" href="#1096">1096</a> 
+<a name="1097" href="#1097">1097</a>     <em>/**<em>*</em></em>
+<a name="1098" href="#1098">1098</a> <em>     * @see Node#addNode(String, String)</em>
+<a name="1099" href="#1099">1099</a> <em>     */</em>
+<a name="1100" href="#1100">1100</a>     <strong>public</strong> <strong>synchronized</strong> <a href="../../../../org/apache/jackrabbit/core/NodeImpl.html">NodeImpl</a> addNode(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> nodeName, <a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> nodeTypeName)
+<a name="1101" href="#1101">1101</a>             throws ItemExistsException, NoSuchNodeTypeException,
+<a name="1102" href="#1102">1102</a>             ConstraintViolationException, RepositoryException {
+<a name="1103" href="#1103">1103</a>         <em class="comment">// check state of this instance</em>
+<a name="1104" href="#1104">1104</a>         sanityCheck();
+<a name="1105" href="#1105">1105</a> 
+<a name="1106" href="#1106">1106</a>         <a href="../../../../org/apache/jackrabbit/core/nodetype/NodeTypeImpl.html">NodeTypeImpl</a> nt = session.getNodeTypeManager().getNodeType(nodeTypeName);
+<a name="1107" href="#1107">1107</a>         <strong>return</strong> internalAddChildNode(nodeName, nt);
+<a name="1108" href="#1108">1108</a>     }
+<a name="1109" href="#1109">1109</a> 
+<a name="1110" href="#1110">1110</a>     <em>/**<em>*</em></em>
+<a name="1111" href="#1111">1111</a> <em>     * Same as &lt;code>{@link Node#setProperty(String, String)}&lt;/code> except that</em>
+<a name="1112" href="#1112">1112</a> <em>     * this method takes a &lt;code>QName&lt;/code> instead of a &lt;code>String&lt;/code></em>
+<a name="1113" href="#1113">1113</a> <em>     * value.</em>
+<a name="1114" href="#1114">1114</a> <em>     *</em>
+<a name="1115" href="#1115">1115</a> <em>     * @param name</em>
+<a name="1116" href="#1116">1116</a> <em>     * @param value</em>
+<a name="1117" href="#1117">1117</a> <em>     * @return</em>
+<a name="1118" href="#1118">1118</a> <em>     * @throws ValueFormatException</em>
+<a name="1119" href="#1119">1119</a> <em>     * @throws RepositoryException</em>
+<a name="1120" href="#1120">1120</a> <em>     */</em>
+<a name="1121" href="#1121">1121</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> setProperty(String name, <a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> value) throws ValueFormatException, RepositoryException {
+<a name="1122" href="#1122">1122</a>         <em class="comment">// check state of this instance</em>
+<a name="1123" href="#1123">1123</a>         sanityCheck();
+<a name="1124" href="#1124">1124</a> 
+<a name="1125" href="#1125">1125</a>         BitSet status = <strong>new</strong> BitSet();
+<a name="1126" href="#1126">1126</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> prop = getOrCreateProperty(name, PropertyType.NAME, false, status);
+<a name="1127" href="#1127">1127</a>         <strong>try</strong> {
+<a name="1128" href="#1128">1128</a>             prop.setValue(value);
+<a name="1129" href="#1129">1129</a>         } <strong>catch</strong> (RepositoryException re) {
+<a name="1130" href="#1130">1130</a>             <strong>if</strong> (status.get(CREATED)) {
+<a name="1131" href="#1131">1131</a>                 <em class="comment">// setting value failed, get rid of newly created property</em>
+<a name="1132" href="#1132">1132</a>                 removeChildProperty(name);
+<a name="1133" href="#1133">1133</a>             }
+<a name="1134" href="#1134">1134</a>             <em class="comment">// rethrow</em>
+<a name="1135" href="#1135">1135</a>             <strong>throw</strong> re;
+<a name="1136" href="#1136">1136</a>         }
+<a name="1137" href="#1137">1137</a>         <strong>return</strong> prop;
+<a name="1138" href="#1138">1138</a>     }
+<a name="1139" href="#1139">1139</a> 
+<a name="1140" href="#1140">1140</a>     <em>/**<em>*</em></em>
+<a name="1141" href="#1141">1141</a> <em>     * Same as &lt;code>{@link Node#setProperty(String, String[])}&lt;/code> except that</em>
+<a name="1142" href="#1142">1142</a> <em>     * this method takes an array of  &lt;code>QName&lt;/code> instead of a</em>
+<a name="1143" href="#1143">1143</a> <em>     * &lt;code>String&lt;/code> values.</em>
+<a name="1144" href="#1144">1144</a> <em>     *</em>
+<a name="1145" href="#1145">1145</a> <em>     * @param name</em>
+<a name="1146" href="#1146">1146</a> <em>     * @param values</em>
+<a name="1147" href="#1147">1147</a> <em>     * @return</em>
+<a name="1148" href="#1148">1148</a> <em>     * @throws ValueFormatException</em>
+<a name="1149" href="#1149">1149</a> <em>     * @throws RepositoryException</em>
+<a name="1150" href="#1150">1150</a> <em>     */</em>
+<a name="1151" href="#1151">1151</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> setProperty(String name, <a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a>[] values) throws ValueFormatException, RepositoryException {
+<a name="1152" href="#1152">1152</a>         <em class="comment">// check state of this instance</em>
+<a name="1153" href="#1153">1153</a>         sanityCheck();
+<a name="1154" href="#1154">1154</a> 
+<a name="1155" href="#1155">1155</a>         BitSet status = <strong>new</strong> BitSet();
+<a name="1156" href="#1156">1156</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> prop = getOrCreateProperty(name, PropertyType.NAME, <strong>true</strong>, status);
+<a name="1157" href="#1157">1157</a>         <strong>try</strong> {
+<a name="1158" href="#1158">1158</a>             prop.setValue(values);
+<a name="1159" href="#1159">1159</a>         } <strong>catch</strong> (RepositoryException re) {
+<a name="1160" href="#1160">1160</a>             <strong>if</strong> (status.get(CREATED)) {
+<a name="1161" href="#1161">1161</a>                 <em class="comment">// setting value failed, get rid of newly created property</em>
+<a name="1162" href="#1162">1162</a>                 removeChildProperty(name);
+<a name="1163" href="#1163">1163</a>             }
+<a name="1164" href="#1164">1164</a>             <em class="comment">// rethrow</em>
+<a name="1165" href="#1165">1165</a>             <strong>throw</strong> re;
+<a name="1166" href="#1166">1166</a>         }
+<a name="1167" href="#1167">1167</a>         <strong>return</strong> prop;
+<a name="1168" href="#1168">1168</a>     }
+<a name="1169" href="#1169">1169</a> 
+<a name="1170" href="#1170">1170</a>     <em>/**<em>*</em></em>
+<a name="1171" href="#1171">1171</a> <em>     * Same as &lt;code>{@link Node#setProperty(String, Value[])}&lt;/code> except that</em>
+<a name="1172" href="#1172">1172</a> <em>     * this method takes a &lt;code>QName&lt;/code> name argument instead of a</em>
+<a name="1173" href="#1173">1173</a> <em>     * &lt;code>String&lt;/code>.</em>
+<a name="1174" href="#1174">1174</a> <em>     *</em>
+<a name="1175" href="#1175">1175</a> <em>     * @param name</em>
+<a name="1176" href="#1176">1176</a> <em>     * @param values</em>
+<a name="1177" href="#1177">1177</a> <em>     * @return</em>
+<a name="1178" href="#1178">1178</a> <em>     * @throws ValueFormatException</em>
+<a name="1179" href="#1179">1179</a> <em>     * @throws RepositoryException</em>
+<a name="1180" href="#1180">1180</a> <em>     */</em>
+<a name="1181" href="#1181">1181</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> setProperty(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name, Value[] values)
+<a name="1182" href="#1182">1182</a>             throws ValueFormatException, RepositoryException {
+<a name="1183" href="#1183">1183</a>         <em class="comment">// check state of this instance</em>
+<a name="1184" href="#1184">1184</a>         sanityCheck();
+<a name="1185" href="#1185">1185</a> 
+<a name="1186" href="#1186">1186</a>         <strong>int</strong> type;
+<a name="1187" href="#1187">1187</a>         <strong>if</strong> (values == <strong>null</strong> || values.length == 0) {
+<a name="1188" href="#1188">1188</a>             type = PropertyType.STRING;
+<a name="1189" href="#1189">1189</a>         } <strong>else</strong> {
+<a name="1190" href="#1190">1190</a>             type = values[0].getType();
+<a name="1191" href="#1191">1191</a>         }
+<a name="1192" href="#1192">1192</a>         BitSet status = <strong>new</strong> BitSet();
+<a name="1193" href="#1193">1193</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> prop = getOrCreateProperty(name, type, <strong>true</strong>, status);
+<a name="1194" href="#1194">1194</a>         <strong>try</strong> {
+<a name="1195" href="#1195">1195</a>             prop.setValue(values);
+<a name="1196" href="#1196">1196</a>         } <strong>catch</strong> (RepositoryException re) {
+<a name="1197" href="#1197">1197</a>             <strong>if</strong> (status.get(CREATED)) {
+<a name="1198" href="#1198">1198</a>                 <em class="comment">// setting value failed, get rid of newly created property</em>
+<a name="1199" href="#1199">1199</a>                 removeChildProperty(name);
+<a name="1200" href="#1200">1200</a>             }
+<a name="1201" href="#1201">1201</a>             <em class="comment">// rethrow</em>
+<a name="1202" href="#1202">1202</a>             <strong>throw</strong> re;
+<a name="1203" href="#1203">1203</a>         }
+<a name="1204" href="#1204">1204</a>         <strong>return</strong> prop;
+<a name="1205" href="#1205">1205</a>     }
+<a name="1206" href="#1206">1206</a> 
+<a name="1207" href="#1207">1207</a>     <em>/**<em>*</em></em>
+<a name="1208" href="#1208">1208</a> <em>     * Same as &lt;code>{@link Node#setProperty(String, Value)}&lt;/code> except that</em>
+<a name="1209" href="#1209">1209</a> <em>     * this method takes a &lt;code>QName&lt;/code> name argument instead of a</em>
+<a name="1210" href="#1210">1210</a> <em>     * &lt;code>String&lt;/code>.</em>
+<a name="1211" href="#1211">1211</a> <em>     *</em>
+<a name="1212" href="#1212">1212</a> <em>     * @param name</em>
+<a name="1213" href="#1213">1213</a> <em>     * @param value</em>
+<a name="1214" href="#1214">1214</a> <em>     * @return</em>
+<a name="1215" href="#1215">1215</a> <em>     * @throws ValueFormatException</em>
+<a name="1216" href="#1216">1216</a> <em>     * @throws RepositoryException</em>
+<a name="1217" href="#1217">1217</a> <em>     */</em>
+<a name="1218" href="#1218">1218</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> setProperty(<a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name, Value value)
+<a name="1219" href="#1219">1219</a>             throws ValueFormatException, RepositoryException {
+<a name="1220" href="#1220">1220</a>         <em class="comment">// check state of this instance</em>
+<a name="1221" href="#1221">1221</a>         sanityCheck();
+<a name="1222" href="#1222">1222</a> 
+<a name="1223" href="#1223">1223</a>         <strong>int</strong> type = (value == <strong>null</strong>) ? PropertyType.STRING : value.getType();
+<a name="1224" href="#1224">1224</a> 
+<a name="1225" href="#1225">1225</a>         BitSet status = <strong>new</strong> BitSet();
+<a name="1226" href="#1226">1226</a>         <a href="../../../../org/apache/jackrabbit/core/PropertyImpl.html">PropertyImpl</a> prop = getOrCreateProperty(name, type, false, status);
+<a name="1227" href="#1227">1227</a>         <strong>try</strong> {
+<a name="1228" href="#1228">1228</a>             prop.setValue(value);
+<a name="1229" href="#1229">1229</a>         } <strong>catch</strong> (RepositoryException re) {
+<a name="1230" href="#1230">1230</a>             <strong>if</strong> (status.get(CREATED)) {
+<a name="1231" href="#1231">1231</a>                 <em class="comment">// setting value failed, get rid of newly created property</em>
+<a name="1232" href="#1232">1232</a>                 removeChildProperty(name);
+<a name="1233" href="#1233">1233</a>             }
+<a name="1234" href="#1234">1234</a>             <em class="comment">// rethrow</em>
+<a name="1235" href="#1235">1235</a>             <strong>throw</strong> re;
+<a name="1236" href="#1236">1236</a>         }
+<a name="1237" href="#1237">1237</a>         <strong>return</strong> prop;
+<a name="1238" href="#1238">1238</a>     }
+<a name="1239" href="#1239">1239</a> 
+<a name="1240" href="#1240">1240</a>     <em>/**<em>*</em></em>
+<a name="1241" href="#1241">1241</a> <em>     * @see ItemImpl#getQName()</em>
+<a name="1242" href="#1242">1242</a> <em>     */</em>
+<a name="1243" href="#1243">1243</a>     <strong>public</strong> <a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> getQName() throws RepositoryException {
+<a name="1244" href="#1244">1244</a>         <strong>return</strong> session.getHierarchyManager().getName(id);
+<a name="1245" href="#1245">1245</a>     }
+<a name="1246" href="#1246">1246</a> 
+<a name="1247" href="#1247">1247</a>     <em class="comment">//-----------------------------------------------------------------&lt; Item ></em>
+<a name="1248" href="#1248">1248</a>     <em>/**<em>*</em></em>
+<a name="1249" href="#1249">1249</a> <em>     * @see Item#isNode()</em>
+<a name="1250" href="#1250">1250</a> <em>     */</em>
+<a name="1251" href="#1251">1251</a>     <strong>public</strong> <strong>boolean</strong> isNode() {
+<a name="1252" href="#1252">1252</a>         <strong>return</strong> <strong>true</strong>;
+<a name="1253" href="#1253">1253</a>     }
+<a name="1254" href="#1254">1254</a> 
+<a name="1255" href="#1255">1255</a>     <em>/**<em>*</em></em>
+<a name="1256" href="#1256">1256</a> <em>     * @see Item#getName</em>
+<a name="1257" href="#1257">1257</a> <em>     */</em>
+<a name="1258" href="#1258">1258</a>     <strong>public</strong> String getName() throws RepositoryException {
+<a name="1259" href="#1259">1259</a>         <strong>if</strong> (state.getParentUUID() == <strong>null</strong>) {
+<a name="1260" href="#1260">1260</a>             <em class="comment">// this is the root node</em>
+<a name="1261" href="#1261">1261</a>             <strong>return</strong> <span class="string">""</span>;
+<a name="1262" href="#1262">1262</a>         }
+<a name="1263" href="#1263">1263</a> 
+<a name="1264" href="#1264">1264</a>         <em class="comment">//QName name = getPrimaryPath().getNameElement().getName();</em>
+<a name="1265" href="#1265">1265</a>         <a href="../../../../org/apache/jackrabbit/core/QName.html">QName</a> name = session.getHierarchyManager().getName(id);
+<a name="1266" href="#1266">1266</a>         <strong>try</strong> {
+<a name="1267" href="#1267">1267</a>             <strong>return</strong> name.toJCRName(session.getNamespaceResolver());
+<a name="1268" href="#1268">1268</a>         } <strong>catch</strong> (NoPrefixDeclaredException npde) {
+<a name="1269" href="#1269">1269</a>             <em class="comment">// should never get here...</em>
+<a name="1270" href="#1270">1270</a>             String msg = <span class="string">"internal error: encountered unregistered namespace "</span> + name.getNamespaceURI();
+<a name="1271" href="#1271">1271</a>             log.error(msg, npde);
+<a name="1272" href="#1272">1272</a>             <strong>throw</strong> <strong>new</strong> RepositoryException(msg, npde);
+<a name="1273" href="#1273">1273</a>         }
+<a name="1274" href="#1274">1274</a>     }
+<a name="1275" href="#1275">1275</a> 
+<a name="1276" href="#1276">1276</a>     <em>/**<em>*</em></em>
+<a name="1277" href="#1277">1277</a> <em>     * @see Item#accept(ItemVisitor)</em>
+<a name="1278" href="#1278">1278</a> <em>     */</em>
+<a name="1279" href="#1279">1279</a>     <strong>public</strong> <strong>void</strong> accept(ItemVisitor visitor) throws RepositoryException {
+<a name="1280" href="#1280">1280</a>         <em class="comment">// check state of this instance</em>
+<a name="1281" href="#1281">1281</a>         sanityCheck();
+<a name="1282" href="#1282">1282</a> 
+<a name="1283" href="#1283">1283</a>         visitor.visit(<strong>this</strong>);
+<a name="1284" href="#1284">1284</a>     }
+<a name="1285" href="#1285">1285</a> 
+<a name="1286" href="#1286">1286</a>     <em>/**<em>*</em></em>
+<a name="1287" href="#1287">1287</a> <em>     * @see Item#getParent</em>
+<a name="1288" href="#1288">1288</a> <em>     */</em>
+<a name="1289" href="#1289">1289</a>     <strong>public</strong> Node getParent()
+<a name="1290" href="#1290">1290</a>             throws ItemNotFoundException, AccessDeniedException, RepositoryException {
+<a name="1291" href="#1291">1291</a>         <em class="comment">// check state of this instance</em>
+<a name="1292" href="#1292">1292</a>         sanityCheck();
+<a name="1293" href="#1293">1293</a> 
+<a name="1294" href="#1294">1294</a>         <em class="comment">// check if root node</em>
+<a name="1295" href="#1295">1295</a>         <a href="../../../../org/apache/jackrabbit/core/state/NodeState.html">NodeState</a> thisState = (NodeState) state;

[... 4232 lines stripped ...]


Mime
View raw message