blob: 4e38a14ee5682dcda89f8563dbed00e219421ff0 [file] [log] [blame]
<HTML><HEAD><META CONTENT="text/html; charset=UTF-8" HTTP-EQUIV="Content-Type"/><TITLE>EMMA Coverage Report</TITLE><STYLE TYPE="text/css"> TABLE,TD,TH {border-style:solid; border-color:black;} TD,TH {background:white;margin:0;line-height:100%;padding-left:0.5em;padding-right:0.5em;} TD {border-width:0 1px 0 0;} TH {border-width:1px 1px 1px 0;} TR TD.h {color:red;} TABLE {border-spacing:0; border-collapse:collapse;border-width:0 0 1px 1px;} P,H1,H2,H3,TH {font-family:verdana,arial,sans-serif;font-size:10pt;} TD {font-family:courier,monospace;font-size:10pt;} TABLE.hdft {border-spacing:0;border-collapse:collapse;border-style:none;} TABLE.hdft TH,TABLE.hdft TD {border-style:none;line-height:normal;} TABLE.hdft TH.tl,TABLE.hdft TD.tl {background:#6699CC;color:white;} TABLE.hdft TD.nv {background:#6633DD;color:white;} .nv A:link {color:white;} .nv A:visited {color:white;} .nv A:active {color:yellow;} TABLE.hdft A:link {color:white;} TABLE.hdft A:visited {color:white;} TABLE.hdft A:active {color:yellow;} .in {color:#356085;} TABLE.s TD {padding-left:0.25em;padding-right:0.25em;} TABLE.s TD.l {padding-left:0.25em;padding-right:0.25em;text-align:right;background:#F0F0F0;} TABLE.s TR.z TD {background:#FF9999;} TABLE.s TR.p TD {background:#FFFF88;} TABLE.s TR.c TD {background:#CCFFCC;} A:link {color:#0000EE;text-decoration:none;} A:visited {color:#0000EE;text-decoration:none;} A:hover {color:#0000EE;text-decoration:underline;} TABLE.cn {border-width:0 0 1px 0;} TABLE.s {border-width:1px 0 1px 1px;} TD.h {color:red;border-width:0 1px 0 0;} TD.f {border-width:0 1px 0 1px;} TD.hf {color:red;border-width:0 1px 0 1px;} TH.f {border-width:1px 1px 1px 1px;} TR.cis TD {background:#F0F0F0;} TR.cis TD {border-width:1px 1px 1px 0;} TR.cis TD.h {color:red;border-width:1px 1px 1px 0;} TR.cis TD.f {border-width:1px 1px 1px 1px;} TR.cis TD.hf {color:red;border-width:1px 1px 1px 1px;} TD.b {border-style:none;background:transparent;line-height:50%;} TD.bt {border-width:1px 0 0 0;background:transparent;line-height:50%;} TR.o TD {background:#F0F0F0;}TABLE.it {border-style:none;}TABLE.it TD,TABLE.it TH {border-style:none;}</STYLE></HEAD><BODY><TABLE CLASS="hdft" CELLSPACING="0" WIDTH="100%"><TR><TH CLASS="tl"><A HREF="http://www.eclemma.org/">EMMA</A> Coverage Report (generated Fri Feb 20 18:44:54 GMT 2009)</TH></TR><TR><TD CLASS="nv">[<A HREF="../xslUnitTestCoverage.html">all classes</A>][<A HREF="6.html">org.eclipse.wst.sse.core.internal.provisional.model</A>]</TD></TR></TABLE><H2>COVERAGE SUMMARY FOR SOURCE FILE [<SPAN CLASS="in">IModelManagerProposed.java</SPAN>]</H2><TABLE CELLSPACING="0" WIDTH="100%"><TR><TH>name</TH><TH>class, %</TH><TH>method, %</TH><TH>block, %</TH><TH>line, %</TH></TR><TR><TD>IModelManagerProposed.java</TD><TD CLASS="h">0%   (0/1)</TD><TD CLASS="h">0%   (0/2)</TD><TD CLASS="h">0%   (0/15)</TD><TD CLASS="h">0%   (0/4)</TD></TR></TABLE><H3>COVERAGE BREAKDOWN BY CLASS AND METHOD</H3><TABLE CLASS="cn" CELLSPACING="0" WIDTH="100%"><TR><TH CLASS="f">name</TH><TH>class, %</TH><TH>method, %</TH><TH>block, %</TH><TH>line, %</TH></TR><TR><TD CLASS="b"> </TD><TD CLASS="b"> </TD><TD CLASS="b"> </TD><TD CLASS="b"> </TD><TD CLASS="b"> </TD></TR><TR CLASS="cis"><TD CLASS="f">class <A HREF="#0">IModelManagerProposed$AccessType</A></TD><TD CLASS="h">0%   (0/1)</TD><TD CLASS="h">0%   (0/2)</TD><TD CLASS="h">0%   (0/15)</TD><TD CLASS="h">0%   (0/4)</TD></TR><TR><TD CLASS="f"><A HREF="#0">IModelManagerProposed$AccessType (String): void</A></TD><TD> </TD><TD CLASS="h">0%   (0/1)</TD><TD CLASS="h">0%   (0/6)</TD><TD CLASS="h">0%   (0/3)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#2">toString (): String</A></TD><TD> </TD><TD CLASS="h">0%   (0/1)</TD><TD CLASS="h">0%   (0/9)</TD><TD CLASS="h">0%   (0/1)</TD></TR></TABLE><P></P><TABLE CLASS="s" CELLSPACING="0" WIDTH="100%"><TR><TD CLASS="l">1</TD><TD>/*******************************************************************************</TD></TR><TR><TD CLASS="l">2</TD><TD> * Copyright (c) 2001, 2006 IBM Corporation and others.</TD></TR><TR><TD CLASS="l">3</TD><TD> * All rights reserved. This program and the accompanying materials</TD></TR><TR><TD CLASS="l">4</TD><TD> * are made available under the terms of the Eclipse Public License v1.0</TD></TR><TR><TD CLASS="l">5</TD><TD> * which accompanies this distribution, and is available at</TD></TR><TR><TD CLASS="l">6</TD><TD> * http://www.eclipse.org/legal/epl-v10.html</TD></TR><TR><TD CLASS="l">7</TD><TD> *</TD></TR><TR><TD CLASS="l">8</TD><TD> * Contributors:</TD></TR><TR><TD CLASS="l">9</TD><TD> *     IBM Corporation - initial API and implementation</TD></TR><TR><TD CLASS="l">10</TD><TD> *     </TD></TR><TR><TD CLASS="l">11</TD><TD> *******************************************************************************/</TD></TR><TR><TD CLASS="l">12</TD><TD>package org.eclipse.wst.sse.core.internal.provisional.model;</TD></TR><TR><TD CLASS="l">13</TD><TD> </TD></TR><TR><TD CLASS="l">14</TD><TD>import java.io.IOException;</TD></TR><TR><TD CLASS="l">15</TD><TD>import java.io.UnsupportedEncodingException;</TD></TR><TR><TD CLASS="l">16</TD><TD> </TD></TR><TR><TD CLASS="l">17</TD><TD>import org.eclipse.core.runtime.CoreException;</TD></TR><TR><TD CLASS="l">18</TD><TD>import org.eclipse.core.runtime.IPath;</TD></TR><TR><TD CLASS="l">19</TD><TD>import org.eclipse.core.runtime.IProgressMonitor;</TD></TR><TR><TD CLASS="l">20</TD><TD>import org.eclipse.jface.text.IDocument;</TD></TR><TR><TD CLASS="l">21</TD><TD>import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;</TD></TR><TR><TD CLASS="l">22</TD><TD>import org.eclipse.wst.sse.core.internal.provisional.exceptions.ResourceAlreadyExists;</TD></TR><TR><TD CLASS="l">23</TD><TD>import org.eclipse.wst.sse.core.internal.provisional.exceptions.ResourceInUse;</TD></TR><TR><TD CLASS="l">24</TD><TD>import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;</TD></TR><TR><TD CLASS="l">25</TD><TD> </TD></TR><TR><TD CLASS="l">26</TD><TD>/**</TD></TR><TR><TD CLASS="l">27</TD><TD> * Responsible for managing IStructuredModels.</TD></TR><TR><TD CLASS="l">28</TD><TD> * </TD></TR><TR><TD CLASS="l">29</TD><TD> * This allows clients to share models, so they do not have to be re-created</TD></TR><TR><TD CLASS="l">30</TD><TD> * or passed around from one client to another. Clients should internally</TD></TR><TR><TD CLASS="l">31</TD><TD> * enforce that models are gotten and released from locations close to each</TD></TR><TR><TD CLASS="l">32</TD><TD> * other to prevent model leaks.</TD></TR><TR><TD CLASS="l">33</TD><TD> * </TD></TR><TR><TD CLASS="l">34</TD><TD> * There are three ways to get a model based on usage and responsibility: for</TD></TR><TR><TD CLASS="l">35</TD><TD> * 'MODIFY', just for 'SHARED', and 'UNSHARED'. Contrary to their names, a</TD></TR><TR><TD CLASS="l">36</TD><TD> * model can technically be modified, and all modifications directly affect</TD></TR><TR><TD CLASS="l">37</TD><TD> * the commonly shared version of the model. It is part of the API contract,</TD></TR><TR><TD CLASS="l">38</TD><TD> * however, that clients who get a model for SHARED do not modify it. The</TD></TR><TR><TD CLASS="l">39</TD><TD> * significance of the 'MODIFY' model is that the client is registering their</TD></TR><TR><TD CLASS="l">40</TD><TD> * interest in saving changes to the model.</TD></TR><TR><TD CLASS="l">41</TD><TD> * </TD></TR><TR><TD CLASS="l">42</TD><TD> * Clients can reference this interface, but should not implement.</TD></TR><TR><TD CLASS="l">43</TD><TD> * </TD></TR><TR><TD CLASS="l">44</TD><TD> * @see org.eclipse.wst.sse.core.StructuredModelManager</TD></TR><TR><TD CLASS="l">45</TD><TD> * @plannedfor 1.0</TD></TR><TR><TD CLASS="l">46</TD><TD> */</TD></TR><TR><TD CLASS="l">47</TD><TD>public interface IModelManagerProposed {</TD></TR><TR><TD CLASS="l">48</TD><TD> </TD></TR><TR><TD CLASS="l">49</TD><TD>        /**</TD></TR><TR><TD CLASS="l">50</TD><TD>         * AccessType is used internally as a JRE 1.4 compatible enumerated type.</TD></TR><TR><TD CLASS="l">51</TD><TD>         * Not intended to be referenced by clients.</TD></TR><TR><TD CLASS="l">52</TD><TD>         */</TD></TR><TR><TD CLASS="l">53</TD><TD>        static class AccessType {</TD></TR><TR><TD CLASS="l">54</TD><TD>                private String fType;</TD></TR><TR><TD CLASS="l">55</TD><TD> </TD></TR><TR><TD CLASS="l">56</TD><TD>                /**</TD></TR><TR><TD CLASS="l">57</TD><TD>                 * default access contructor we use to create our specific constants.</TD></TR><TR><TD CLASS="l"><A NAME="0">58</A></TD><TD>                 * </TD></TR><TR><TD CLASS="l">59</TD><TD>                 * @param type</TD></TR><TR><TD CLASS="l">60</TD><TD>                 */</TD></TR><TR><TD CLASS="l">61</TD><TD>                AccessType(String type) {</TD></TR><TR CLASS="z"><TD CLASS="l">62</TD><TD>                        super();</TD></TR><TR CLASS="z"><TD CLASS="l">63</TD><TD>                        fType = type;</TD></TR><TR CLASS="z"><TD CLASS="l">64</TD><TD>                }</TD></TR><TR><TD CLASS="l">65</TD><TD> </TD></TR><TR><TD CLASS="l"><A NAME="2">66</A></TD><TD>                /**</TD></TR><TR><TD CLASS="l">67</TD><TD>                 * For debug purposes only.</TD></TR><TR><TD CLASS="l">68</TD><TD>                 */</TD></TR><TR><TD CLASS="l">69</TD><TD>                public String toString() {</TD></TR><TR CLASS="z"><TD CLASS="l">70</TD><TD>                        return &#34;Model Access Type: &#34; + fType; //$NON-NLS-1$</TD></TR><TR><TD CLASS="l">71</TD><TD>                }</TD></TR><TR><TD CLASS="l">72</TD><TD>        }</TD></TR><TR><TD CLASS="l">73</TD><TD> </TD></TR><TR><TD CLASS="l">74</TD><TD>        /**</TD></TR><TR><TD CLASS="l">75</TD><TD>         * Constant to provide compile time safe parameter. &lt;code&gt;NOTSHARED&lt;/code&gt;signifies</TD></TR><TR><TD CLASS="l">76</TD><TD>         * the client intentially wants a model that is not shared with other</TD></TR><TR><TD CLASS="l">77</TD><TD>         * clients. NOTSHARED models can not be saved.</TD></TR><TR><TD CLASS="l">78</TD><TD>         */</TD></TR><TR><TD CLASS="l">79</TD><TD>        final AccessType NOTSHARED = new AccessType(&#34;NOTSHARED&#34;); //$NON-NLS-1$</TD></TR><TR><TD CLASS="l">80</TD><TD> </TD></TR><TR><TD CLASS="l">81</TD><TD>        /**</TD></TR><TR><TD CLASS="l">82</TD><TD>         * Constant to provide compile-time safe parameter. &lt;code&gt;SHARED&lt;/code&gt;signifies</TD></TR><TR><TD CLASS="l">83</TD><TD>         * the client is not intending to make changes and does not care whether</TD></TR><TR><TD CLASS="l">84</TD><TD>         * the model accessed is saved.</TD></TR><TR><TD CLASS="l">85</TD><TD>         */</TD></TR><TR><TD CLASS="l">86</TD><TD>        final AccessType SHARED = new AccessType(&#34;SHARED&#34;); //$NON-NLS-1$</TD></TR><TR><TD CLASS="l">87</TD><TD> </TD></TR><TR><TD CLASS="l">88</TD><TD>        /**</TD></TR><TR><TD CLASS="l">89</TD><TD>         * Constant to provide compile-time safe parameter. &lt;code&gt;MODIFY&lt;/code&gt;signifies</TD></TR><TR><TD CLASS="l">90</TD><TD>         * the client is intending to make changes and is responsible for saving</TD></TR><TR><TD CLASS="l">91</TD><TD>         * changes (or not) if they are the last one holding MODIFY access to the</TD></TR><TR><TD CLASS="l">92</TD><TD>         * model before it's released.</TD></TR><TR><TD CLASS="l">93</TD><TD>         */</TD></TR><TR><TD CLASS="l">94</TD><TD>        final AccessType MODIFY = new AccessType(&#34;MODIFY&#34;); //$NON-NLS-1$</TD></TR><TR><TD CLASS="l">95</TD><TD> </TD></TR><TR><TD CLASS="l">96</TD><TD>        /**</TD></TR><TR><TD CLASS="l">97</TD><TD>         * copyModel is similar to a deep clone. The resulting model is shared,</TD></TR><TR><TD CLASS="l">98</TD><TD>         * according to the value of ReadEditType. If a model already is being</TD></TR><TR><TD CLASS="l">99</TD><TD>         * managed for 'newLocation' then a ResourceInUse exception is thrown,</TD></TR><TR><TD CLASS="l">100</TD><TD>         * unless the ReadEditType is NOTSHARED, in which case the resulting model</TD></TR><TR><TD CLASS="l">101</TD><TD>         * can not be saved.</TD></TR><TR><TD CLASS="l">102</TD><TD>         * </TD></TR><TR><TD CLASS="l">103</TD><TD>         * @param oldLocation</TD></TR><TR><TD CLASS="l">104</TD><TD>         * @param newLocation</TD></TR><TR><TD CLASS="l">105</TD><TD>         * @param type</TD></TR><TR><TD CLASS="l">106</TD><TD>         * @return</TD></TR><TR><TD CLASS="l">107</TD><TD>         * @throws ResourceInUse</TD></TR><TR><TD CLASS="l">108</TD><TD>         * </TD></TR><TR><TD CLASS="l">109</TD><TD>         * ISSUE: is this important enough to be API, or can clients solve</TD></TR><TR><TD CLASS="l">110</TD><TD>         * themselves</TD></TR><TR><TD CLASS="l">111</TD><TD>         */</TD></TR><TR><TD CLASS="l">112</TD><TD>        IStructuredModel copyModel(IPath oldLocation, IPath newLocation, AccessType type) throws ResourceInUse;</TD></TR><TR><TD CLASS="l">113</TD><TD> </TD></TR><TR><TD CLASS="l">114</TD><TD>        /**</TD></TR><TR><TD CLASS="l">115</TD><TD>         * createNewInstance is similar to clone, except the new instance has no</TD></TR><TR><TD CLASS="l">116</TD><TD>         * text content. Note: this produces an UNSHARED model, for temporary use,</TD></TR><TR><TD CLASS="l">117</TD><TD>         * that has the same characteristics as original model. If a true shared</TD></TR><TR><TD CLASS="l">118</TD><TD>         * model is desired, use &#34;copy&#34;.</TD></TR><TR><TD CLASS="l">119</TD><TD>         * </TD></TR><TR><TD CLASS="l">120</TD><TD>         * ISSUE: still needed?</TD></TR><TR><TD CLASS="l">121</TD><TD>         * </TD></TR><TR><TD CLASS="l">122</TD><TD>         * @param requester</TD></TR><TR><TD CLASS="l">123</TD><TD>         * @param model</TD></TR><TR><TD CLASS="l">124</TD><TD>         * @return</TD></TR><TR><TD CLASS="l">125</TD><TD>         * @throws IOException</TD></TR><TR><TD CLASS="l">126</TD><TD>         */</TD></TR><TR><TD CLASS="l">127</TD><TD>        public IStructuredModel createNewInstance(Object requester, IStructuredModel model) throws IOException;</TD></TR><TR><TD CLASS="l">128</TD><TD> </TD></TR><TR><TD CLASS="l">129</TD><TD>        /**</TD></TR><TR><TD CLASS="l">130</TD><TD>         * Factory method, since a proper IStructuredDocument must have a proper</TD></TR><TR><TD CLASS="l">131</TD><TD>         * parser assigned. Note: its assume that IPath does not actually exist as</TD></TR><TR><TD CLASS="l">132</TD><TD>         * a resource yet. If it does, ResourceAlreadyExists exception is thrown.</TD></TR><TR><TD CLASS="l">133</TD><TD>         * If the resource does already exist, then createStructuredDocumentFor is</TD></TR><TR><TD CLASS="l">134</TD><TD>         * the right API to use.</TD></TR><TR><TD CLASS="l">135</TD><TD>         * </TD></TR><TR><TD CLASS="l">136</TD><TD>         * ISSUE: do we want to support this via model manager, or else where?</TD></TR><TR><TD CLASS="l">137</TD><TD>         * ISSUE: do we need two of these? What's legacy use case?</TD></TR><TR><TD CLASS="l">138</TD><TD>         * </TD></TR><TR><TD CLASS="l">139</TD><TD>         * @param location</TD></TR><TR><TD CLASS="l">140</TD><TD>         * @param progressMonitor</TD></TR><TR><TD CLASS="l">141</TD><TD>         * @return</TD></TR><TR><TD CLASS="l">142</TD><TD>         * @throws ResourceAlreadyExists</TD></TR><TR><TD CLASS="l">143</TD><TD>         * @throws IOException</TD></TR><TR><TD CLASS="l">144</TD><TD>         * @throws CoreException</TD></TR><TR><TD CLASS="l">145</TD><TD>         */</TD></TR><TR><TD CLASS="l">146</TD><TD>        IStructuredDocument createNewStructuredDocumentFor(IPath location, IProgressMonitor progressMonitor) throws ResourceAlreadyExists, IOException, CoreException;</TD></TR><TR><TD CLASS="l">147</TD><TD> </TD></TR><TR><TD CLASS="l">148</TD><TD>        /**</TD></TR><TR><TD CLASS="l">149</TD><TD>         * Factory method, since a proper IStructuredDocument must have a proper</TD></TR><TR><TD CLASS="l">150</TD><TD>         * parser assigned. Note: clients should verify that the resource</TD></TR><TR><TD CLASS="l">151</TD><TD>         * identified by the IPath exists before using this method. If this IFile</TD></TR><TR><TD CLASS="l">152</TD><TD>         * does not exist, then createNewStructuredDocument is the correct API to</TD></TR><TR><TD CLASS="l">153</TD><TD>         * use.</TD></TR><TR><TD CLASS="l">154</TD><TD>         * </TD></TR><TR><TD CLASS="l">155</TD><TD>         * ISSUE: do we want to support this via model manager, or else where?</TD></TR><TR><TD CLASS="l">156</TD><TD>         * ISSUE: do we need two of these? What's legacy use case?</TD></TR><TR><TD CLASS="l">157</TD><TD>         * </TD></TR><TR><TD CLASS="l">158</TD><TD>         * @param location</TD></TR><TR><TD CLASS="l">159</TD><TD>         * @param progressMonitor</TD></TR><TR><TD CLASS="l">160</TD><TD>         * @return</TD></TR><TR><TD CLASS="l">161</TD><TD>         * @throws IOException</TD></TR><TR><TD CLASS="l">162</TD><TD>         * @throws CoreException</TD></TR><TR><TD CLASS="l">163</TD><TD>         */</TD></TR><TR><TD CLASS="l">164</TD><TD>        IStructuredDocument createStructuredDocumentFor(IPath location, IProgressMonitor progressMonitor) throws IOException, CoreException;</TD></TR><TR><TD CLASS="l">165</TD><TD> </TD></TR><TR><TD CLASS="l">166</TD><TD>        /**</TD></TR><TR><TD CLASS="l">167</TD><TD>         * Note: callers of this method must still release the model when</TD></TR><TR><TD CLASS="l">168</TD><TD>         * finished. Returns the model for this document if it already exists and</TD></TR><TR><TD CLASS="l">169</TD><TD>         * is being shared. Returns null if this is not the case. The ReadEditType</TD></TR><TR><TD CLASS="l">170</TD><TD>         * must be either MODIFY or SHARED.</TD></TR><TR><TD CLASS="l">171</TD><TD>         * </TD></TR><TR><TD CLASS="l">172</TD><TD>         * ISSUE: should we accept IDocument on parameter for future evolution,</TD></TR><TR><TD CLASS="l">173</TD><TD>         * and constrain to StructuredDocuments at runtime?</TD></TR><TR><TD CLASS="l">174</TD><TD>         * </TD></TR><TR><TD CLASS="l">175</TD><TD>         * @param requester</TD></TR><TR><TD CLASS="l">176</TD><TD>         * @param type</TD></TR><TR><TD CLASS="l">177</TD><TD>         * @param document</TD></TR><TR><TD CLASS="l">178</TD><TD>         * @return</TD></TR><TR><TD CLASS="l">179</TD><TD>         */</TD></TR><TR><TD CLASS="l">180</TD><TD>        IStructuredModel getExistingModel(Object requester, AccessType type, IDocument document);</TD></TR><TR><TD CLASS="l">181</TD><TD> </TD></TR><TR><TD CLASS="l">182</TD><TD>        /**</TD></TR><TR><TD CLASS="l">183</TD><TD>         * Callers of this method must still release the model when finished.</TD></TR><TR><TD CLASS="l">184</TD><TD>         * Returns the model for this location if it already exists and is being</TD></TR><TR><TD CLASS="l">185</TD><TD>         * shared. Returns null if this is not the case. The ReadEditType must be</TD></TR><TR><TD CLASS="l">186</TD><TD>         * either MODIFY or SHARED.</TD></TR><TR><TD CLASS="l">187</TD><TD>         * </TD></TR><TR><TD CLASS="l">188</TD><TD>         * @param requester</TD></TR><TR><TD CLASS="l">189</TD><TD>         * @param type</TD></TR><TR><TD CLASS="l">190</TD><TD>         * @param location</TD></TR><TR><TD CLASS="l">191</TD><TD>         * @return</TD></TR><TR><TD CLASS="l">192</TD><TD>         */</TD></TR><TR><TD CLASS="l">193</TD><TD>        public IStructuredModel getExistingModel(Object requester, AccessType type, IPath location);</TD></TR><TR><TD CLASS="l">194</TD><TD> </TD></TR><TR><TD CLASS="l">195</TD><TD>        /**</TD></TR><TR><TD CLASS="l">196</TD><TD>         * Returns the model that has the specified document as its structured</TD></TR><TR><TD CLASS="l">197</TD><TD>         * document.</TD></TR><TR><TD CLASS="l">198</TD><TD>         * </TD></TR><TR><TD CLASS="l">199</TD><TD>         * @param requester</TD></TR><TR><TD CLASS="l">200</TD><TD>         * @param type</TD></TR><TR><TD CLASS="l">201</TD><TD>         * @param progressMonitor</TD></TR><TR><TD CLASS="l">202</TD><TD>         * @param document</TD></TR><TR><TD CLASS="l">203</TD><TD>         * @return</TD></TR><TR><TD CLASS="l">204</TD><TD>         */</TD></TR><TR><TD CLASS="l">205</TD><TD>        public IStructuredModel getModel(Object requester, AccessType type, IProgressMonitor progressMonitor, IDocument document);</TD></TR><TR><TD CLASS="l">206</TD><TD> </TD></TR><TR><TD CLASS="l">207</TD><TD>        /**</TD></TR><TR><TD CLASS="l">208</TD><TD>         * Returns the model based on the content at the specified location.</TD></TR><TR><TD CLASS="l">209</TD><TD>         * </TD></TR><TR><TD CLASS="l">210</TD><TD>         * Note: if the ModelManager does not know how to create a model for </TD></TR><TR><TD CLASS="l">211</TD><TD>         * such a file for content, null is return.</TD></TR><TR><TD CLASS="l">212</TD><TD>         * ISSUE: should we throw some special, meaningful, checked </TD></TR><TR><TD CLASS="l">213</TD><TD>         * exception instead?</TD></TR><TR><TD CLASS="l">214</TD><TD>         * </TD></TR><TR><TD CLASS="l">215</TD><TD>         * @param requester</TD></TR><TR><TD CLASS="l">216</TD><TD>         * @param type</TD></TR><TR><TD CLASS="l">217</TD><TD>         * @param progressMonitor</TD></TR><TR><TD CLASS="l">218</TD><TD>         * @param location</TD></TR><TR><TD CLASS="l">219</TD><TD>         * @return</TD></TR><TR><TD CLASS="l">220</TD><TD>         * @throws IOException</TD></TR><TR><TD CLASS="l">221</TD><TD>         * @throws CoreException</TD></TR><TR><TD CLASS="l">222</TD><TD>         */</TD></TR><TR><TD CLASS="l">223</TD><TD>        public IStructuredModel getModel(Object requester, AccessType type, IProgressMonitor progressMonitor, IPath location) throws IOException, CoreException;</TD></TR><TR><TD CLASS="l">224</TD><TD> </TD></TR><TR><TD CLASS="l">225</TD><TD>        /**</TD></TR><TR><TD CLASS="l">226</TD><TD>         * This method will not create a new model if it already exists ... if</TD></TR><TR><TD CLASS="l">227</TD><TD>         * force is false. The idea is that a client should call this method once</TD></TR><TR><TD CLASS="l">228</TD><TD>         * with force set to false. If the exception is thrown, then prompt client</TD></TR><TR><TD CLASS="l">229</TD><TD>         * if they want to overwrite.</TD></TR><TR><TD CLASS="l">230</TD><TD>         * </TD></TR><TR><TD CLASS="l">231</TD><TD>         * @param requester</TD></TR><TR><TD CLASS="l">232</TD><TD>         * @param location</TD></TR><TR><TD CLASS="l">233</TD><TD>         * @param force</TD></TR><TR><TD CLASS="l">234</TD><TD>         * @param type</TD></TR><TR><TD CLASS="l">235</TD><TD>         * @param progressMonitor</TD></TR><TR><TD CLASS="l">236</TD><TD>         * @return</TD></TR><TR><TD CLASS="l">237</TD><TD>         * @throws ResourceAlreadyExists</TD></TR><TR><TD CLASS="l">238</TD><TD>         * @throws ResourceInUse</TD></TR><TR><TD CLASS="l">239</TD><TD>         * @throws IOException</TD></TR><TR><TD CLASS="l">240</TD><TD>         * @throws CoreException</TD></TR><TR><TD CLASS="l">241</TD><TD>         */</TD></TR><TR><TD CLASS="l">242</TD><TD>        IStructuredModel getNewModel(Object requester, IPath location, boolean force, AccessType type, IProgressMonitor progressMonitor) throws ResourceAlreadyExists, ResourceInUse, IOException, CoreException;</TD></TR><TR><TD CLASS="l">243</TD><TD> </TD></TR><TR><TD CLASS="l">244</TD><TD>        /**</TD></TR><TR><TD CLASS="l">245</TD><TD>         * This function returns true if there are other references to the</TD></TR><TR><TD CLASS="l">246</TD><TD>         * underlying model.</TD></TR><TR><TD CLASS="l">247</TD><TD>         * </TD></TR><TR><TD CLASS="l">248</TD><TD>         * @param location</TD></TR><TR><TD CLASS="l">249</TD><TD>         * @return</TD></TR><TR><TD CLASS="l">250</TD><TD>         */</TD></TR><TR><TD CLASS="l">251</TD><TD>        boolean isShared(IPath location);</TD></TR><TR><TD CLASS="l">252</TD><TD> </TD></TR><TR><TD CLASS="l">253</TD><TD>        /**</TD></TR><TR><TD CLASS="l">254</TD><TD>         * This function returns true if there are other references to the</TD></TR><TR><TD CLASS="l">255</TD><TD>         * underlying model, shared in the specified way. The ReadEditType must be</TD></TR><TR><TD CLASS="l">256</TD><TD>         * either MODIFY or SHARED.</TD></TR><TR><TD CLASS="l">257</TD><TD>         * </TD></TR><TR><TD CLASS="l">258</TD><TD>         * @param location</TD></TR><TR><TD CLASS="l">259</TD><TD>         * @param type</TD></TR><TR><TD CLASS="l">260</TD><TD>         * @return</TD></TR><TR><TD CLASS="l">261</TD><TD>         */</TD></TR><TR><TD CLASS="l">262</TD><TD>        boolean isShared(IPath location, AccessType type);</TD></TR><TR><TD CLASS="l">263</TD><TD> </TD></TR><TR><TD CLASS="l">264</TD><TD>        /**</TD></TR><TR><TD CLASS="l">265</TD><TD>         * This method can be called when the content type of a model changes. Its</TD></TR><TR><TD CLASS="l">266</TD><TD>         * assumed the contentType has already been changed, and this method uses</TD></TR><TR><TD CLASS="l">267</TD><TD>         * the text of the old one, to repopulate the text of the new one.</TD></TR><TR><TD CLASS="l">268</TD><TD>         * </TD></TR><TR><TD CLASS="l">269</TD><TD>         * @param model</TD></TR><TR><TD CLASS="l">270</TD><TD>         * @return</TD></TR><TR><TD CLASS="l">271</TD><TD>         * @throws IOException</TD></TR><TR><TD CLASS="l">272</TD><TD>         */</TD></TR><TR><TD CLASS="l">273</TD><TD>        IStructuredModel reinitialize(IStructuredModel model) throws IOException;</TD></TR><TR><TD CLASS="l">274</TD><TD> </TD></TR><TR><TD CLASS="l">275</TD><TD> </TD></TR><TR><TD CLASS="l">276</TD><TD>        /**</TD></TR><TR><TD CLASS="l">277</TD><TD>         * This is used by clients to signify that they are finished with a model</TD></TR><TR><TD CLASS="l">278</TD><TD>         * and will no longer access it or any of its underlying data (such as its</TD></TR><TR><TD CLASS="l">279</TD><TD>         * structured document). The ReadEditType must match what ever the client</TD></TR><TR><TD CLASS="l">280</TD><TD>         * used in the corresponding 'get' method.</TD></TR><TR><TD CLASS="l">281</TD><TD>         * </TD></TR><TR><TD CLASS="l">282</TD><TD>         * This method must be called for every 'get'. Clients should use the</TD></TR><TR><TD CLASS="l">283</TD><TD>         * try/finally pattern to ensure the release is called even if there is an</TD></TR><TR><TD CLASS="l">284</TD><TD>         * unexpected exception.</TD></TR><TR><TD CLASS="l">285</TD><TD>         * </TD></TR><TR><TD CLASS="l">286</TD><TD>         * @param requester</TD></TR><TR><TD CLASS="l">287</TD><TD>         * @param structuredModel</TD></TR><TR><TD CLASS="l">288</TD><TD>         * @param type</TD></TR><TR><TD CLASS="l">289</TD><TD>         */</TD></TR><TR><TD CLASS="l">290</TD><TD>        void releaseModel(Object requester, IStructuredModel structuredModel, AccessType type);</TD></TR><TR><TD CLASS="l">291</TD><TD> </TD></TR><TR><TD CLASS="l">292</TD><TD>        /**</TD></TR><TR><TD CLASS="l">293</TD><TD>         * Writes the underlying document to the IPath.</TD></TR><TR><TD CLASS="l">294</TD><TD>         * </TD></TR><TR><TD CLASS="l">295</TD><TD>         * ISSUE: we want to just &#34;dump&#34; contents to location, but need to spec.</TD></TR><TR><TD CLASS="l">296</TD><TD>         * all the different cases of shared, etc.</TD></TR><TR><TD CLASS="l">297</TD><TD>         * </TD></TR><TR><TD CLASS="l">298</TD><TD>         * ?If to same location as 'get', then same instance of model, If to</TD></TR><TR><TD CLASS="l">299</TD><TD>         * different location (esp. if shared) then need to leave old instance of</TD></TR><TR><TD CLASS="l">300</TD><TD>         * model, create new model, and save to new location. ?</TD></TR><TR><TD CLASS="l">301</TD><TD>         * </TD></TR><TR><TD CLASS="l">302</TD><TD>         * Cases: IPath is null, write to IPath created with IPath specificed and</TD></TR><TR><TD CLASS="l">303</TD><TD>         * equals IPath created with, write to IPath IPath specified and not</TD></TR><TR><TD CLASS="l">304</TD><TD>         * equals IPath created with, dumps to new IPath, no change in current</TD></TR><TR><TD CLASS="l">305</TD><TD>         * model state.</TD></TR><TR><TD CLASS="l">306</TD><TD>         * </TD></TR><TR><TD CLASS="l">307</TD><TD>         * ISSUE: think through 'normalization' cases</TD></TR><TR><TD CLASS="l">308</TD><TD>         * </TD></TR><TR><TD CLASS="l">309</TD><TD>         * </TD></TR><TR><TD CLASS="l">310</TD><TD>         * @param structuredModel</TD></TR><TR><TD CLASS="l">311</TD><TD>         * @param location - already normalized?</TD></TR><TR><TD CLASS="l">312</TD><TD>         * @param progressMonitor</TD></TR><TR><TD CLASS="l">313</TD><TD>         * @throws UnsupportedEncodingException</TD></TR><TR><TD CLASS="l">314</TD><TD>         * @throws IOException</TD></TR><TR><TD CLASS="l">315</TD><TD>         * @throws CoreException</TD></TR><TR><TD CLASS="l">316</TD><TD>         * </TD></TR><TR><TD CLASS="l">317</TD><TD>         * ISSUE: resource aleady exists? veto override</TD></TR><TR><TD CLASS="l">318</TD><TD>         */</TD></TR><TR><TD CLASS="l">319</TD><TD>        void saveModel(IStructuredModel structuredModel, IPath location, IProgressMonitor progressMonitor) throws UnsupportedEncodingException, IOException, CoreException;</TD></TR><TR><TD CLASS="l">320</TD><TD> </TD></TR><TR><TD CLASS="l">321</TD><TD>        /**</TD></TR><TR><TD CLASS="l">322</TD><TD>         * Writes the underlying document to the IPath if the model is only shared</TD></TR><TR><TD CLASS="l">323</TD><TD>         * for EDIT by one client. This is the recommended way for 'background</TD></TR><TR><TD CLASS="l">324</TD><TD>         * jobs' to save models, in case the model is being shared by an editor,</TD></TR><TR><TD CLASS="l">325</TD><TD>         * or other client that might desire user intervention to save a resource.</TD></TR><TR><TD CLASS="l">326</TD><TD>         * </TD></TR><TR><TD CLASS="l">327</TD><TD>         * @param structuredModel</TD></TR><TR><TD CLASS="l">328</TD><TD>         * @param location - already normalized?</TD></TR><TR><TD CLASS="l">329</TD><TD>         * @param progressMonitor</TD></TR><TR><TD CLASS="l">330</TD><TD>         * @throws UnsupportedEncodingException</TD></TR><TR><TD CLASS="l">331</TD><TD>         * @throws IOException</TD></TR><TR><TD CLASS="l">332</TD><TD>         * @throws CoreException</TD></TR><TR><TD CLASS="l">333</TD><TD>         * </TD></TR><TR><TD CLASS="l">334</TD><TD>         * ISSUE: is locaiton needed in this case, or just use the one it was</TD></TR><TR><TD CLASS="l">335</TD><TD>         * created with</TD></TR><TR><TD CLASS="l">336</TD><TD>         */</TD></TR><TR><TD CLASS="l">337</TD><TD>        void saveModelIfNotShared(IStructuredModel structuredModel, IPath location, IProgressMonitor progressMonitor) throws UnsupportedEncodingException, IOException, CoreException;</TD></TR><TR><TD CLASS="l">338</TD><TD>}</TD></TR></TABLE><P></P><TABLE CLASS="hdft" CELLSPACING="0" WIDTH="100%"><TR><TD CLASS="nv">[<A HREF="../xslUnitTestCoverage.html">all classes</A>][<A HREF="6.html">org.eclipse.wst.sse.core.internal.provisional.model</A>]</TD></TR><TR><TD CLASS="tl"><A HREF="http://www.eclemma.org/support.html">EMMA 2.0.5312 EclEmma Fix 1</A> (C) Vladimir Roubtsov</TD></TR></TABLE></BODY></HTML>