diff options
Diffstat (limited to 'tests/org.eclipse.wst.xml.xpath2.processor.tests/coverageReport/_files/1707.html')
-rw-r--r-- | tests/org.eclipse.wst.xml.xpath2.processor.tests/coverageReport/_files/1707.html | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/tests/org.eclipse.wst.xml.xpath2.processor.tests/coverageReport/_files/1707.html b/tests/org.eclipse.wst.xml.xpath2.processor.tests/coverageReport/_files/1707.html deleted file mode 100644 index b496a946..00000000 --- a/tests/org.eclipse.wst.xml.xpath2.processor.tests/coverageReport/_files/1707.html +++ /dev/null @@ -1 +0,0 @@ -<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 Tue Jun 09 19:59:05 GMT 2009)</TH></TR><TR><TD CLASS="nv">[<A HREF="../xslUnitTestCoverage.html">all classes</A>][<A HREF="230.html">org.eclipse.wst.xml.core.internal.validation.core</A>]</TD></TR></TABLE><H2>COVERAGE SUMMARY FOR SOURCE FILE [<SPAN CLASS="in">ValidationInfo.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>ValidationInfo.java</TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/12)</TD><TD CLASS="h">0% (0/252)</TD><TD CLASS="h">0% (0/65)</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">ValidationInfo</A></TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/12)</TD><TD CLASS="h">0% (0/252)</TD><TD CLASS="h">0% (0/65)</TD></TR><TR><TD CLASS="f"><A HREF="#0"><static initializer></A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/5)</TD><TD CLASS="h">0% (0/3)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#2">ValidationInfo (String): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/38)</TD><TD CLASS="h">0% (0/12)</TD></TR><TR><TD CLASS="f"><A HREF="#3">addError (String, int, int, String): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/9)</TD><TD CLASS="h">0% (0/2)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#4">addError (String, int, int, String, String, Object []): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/14)</TD><TD CLASS="h">0% (0/3)</TD></TR><TR><TD CLASS="f"><A HREF="#5">addMessage (String, int, int, String, int, String, Object []): boolean</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/131)</TD><TD CLASS="h">0% (0/33)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#6">addWarning (String, int, int, String): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/9)</TD><TD CLASS="h">0% (0/2)</TD></TR><TR><TD CLASS="f"><A HREF="#7">addWarning (String, int, int, String, String, Object []): void</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/11)</TD><TD CLASS="h">0% (0/2)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#8">getFileURI (): String</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/3)</TD><TD CLASS="h">0% (0/1)</TD></TR><TR><TD CLASS="f"><A HREF="#9">getNestedMessages (): HashMap</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/3)</TD><TD CLASS="h">0% (0/1)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#a">getValidationMessages (): ValidationMessage []</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><TR><TD CLASS="f"><A HREF="#b">isValid (): boolean</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/3)</TD><TD CLASS="h">0% (0/1)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#c">normalize (String): String</A></TD><TD> </TD><TD CLASS="h">0% (0/1)</TD><TD CLASS="h">0% (0/17)</TD><TD CLASS="h">0% (0/4)</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, 2005 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>package org.eclipse.wst.xml.core.internal.validation.core;</TD></TR><TR><TD CLASS="l">12</TD><TD> </TD></TR><TR><TD CLASS="l">13</TD><TD>import java.net.MalformedURLException;</TD></TR><TR><TD CLASS="l">14</TD><TD>import java.net.URL;</TD></TR><TR><TD CLASS="l">15</TD><TD>import java.util.ArrayList;</TD></TR><TR><TD CLASS="l">16</TD><TD>import java.util.HashMap;</TD></TR><TR><TD CLASS="l">17</TD><TD>import java.util.List;</TD></TR><TR><TD CLASS="l">18</TD><TD> </TD></TR><TR><TD CLASS="l">19</TD><TD>import org.eclipse.osgi.util.NLS;</TD></TR><TR><TD CLASS="l">20</TD><TD>import org.eclipse.wst.xml.core.internal.validation.XMLValidationMessages;</TD></TR><TR><TD CLASS="l">21</TD><TD> </TD></TR><TR><TD CLASS="l">22</TD><TD>/**</TD></TR><TR><TD CLASS="l">23</TD><TD> * This class handles messages from a validator. This class can handle</TD></TR><TR><TD CLASS="l">24</TD><TD> * </TD></TR><TR><TD CLASS="l">25</TD><TD> * @author Lawrence Mandel, IBM</TD></TR><TR><TD CLASS="l"><A NAME="0">26</A></TD><TD> */</TD></TR><TR CLASS="z"><TD CLASS="l">27</TD><TD>public class ValidationInfo implements ValidationReport</TD></TR><TR><TD CLASS="l">28</TD><TD>{</TD></TR><TR CLASS="z"><TD CLASS="l">29</TD><TD> private boolean WRAPPER_ERROR_SUPPORT_ENABLED = true;</TD></TR><TR CLASS="z"><TD CLASS="l">30</TD><TD> public static int SEV_ERROR = 0;</TD></TR><TR CLASS="z"><TD CLASS="l">31</TD><TD> public static int SEV_WARNING = 1;</TD></TR><TR><TD CLASS="l">32</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">33</TD><TD> private String validating_file_uri = null;</TD></TR><TR CLASS="z"><TD CLASS="l">34</TD><TD> private URL validating_file_url = null;</TD></TR><TR CLASS="z"><TD CLASS="l">35</TD><TD> private boolean valid = true;</TD></TR><TR CLASS="z"><TD CLASS="l">36</TD><TD> private List messages = new ArrayList();</TD></TR><TR CLASS="z"><TD CLASS="l">37</TD><TD> private HashMap nestedMessages = new HashMap();</TD></TR><TR><TD CLASS="l">38</TD><TD> </TD></TR><TR><TD CLASS="l">39</TD><TD> /**</TD></TR><TR><TD CLASS="l">40</TD><TD> * Constructor.</TD></TR><TR><TD CLASS="l"><A NAME="2">41</A></TD><TD> * </TD></TR><TR><TD CLASS="l">42</TD><TD> * @param uri</TD></TR><TR><TD CLASS="l">43</TD><TD> * The URI of the file for the validation.</TD></TR><TR><TD CLASS="l">44</TD><TD> */</TD></TR><TR CLASS="z"><TD CLASS="l">45</TD><TD> public ValidationInfo(String uri)</TD></TR><TR><TD CLASS="l">46</TD><TD> {</TD></TR><TR CLASS="z"><TD CLASS="l">47</TD><TD> if(uri != null)</TD></TR><TR><TD CLASS="l">48</TD><TD> {</TD></TR><TR CLASS="z"><TD CLASS="l">49</TD><TD> this.validating_file_uri = uri;</TD></TR><TR><TD CLASS="l">50</TD><TD> try</TD></TR><TR><TD CLASS="l">51</TD><TD> {</TD></TR><TR CLASS="z"><TD CLASS="l">52</TD><TD> this.validating_file_url = new URL(uri);</TD></TR><TR CLASS="z"><TD CLASS="l">53</TD><TD> } catch (MalformedURLException e)</TD></TR><TR><TD CLASS="l">54</TD><TD> {</TD></TR><TR><TD CLASS="l">55</TD><TD> }</TD></TR><TR><TD CLASS="l">56</TD><TD> }</TD></TR><TR CLASS="z"><TD CLASS="l"><A NAME="8">57</A></TD><TD> }</TD></TR><TR><TD CLASS="l">58</TD><TD> </TD></TR><TR><TD CLASS="l">59</TD><TD> public String getFileURI()</TD></TR><TR><TD CLASS="l">60</TD><TD> {</TD></TR><TR CLASS="z"><TD CLASS="l">61</TD><TD> return validating_file_uri;</TD></TR><TR><TD CLASS="l"><A NAME="b">62</A></TD><TD> }</TD></TR><TR><TD CLASS="l">63</TD><TD> </TD></TR><TR><TD CLASS="l">64</TD><TD> public boolean isValid()</TD></TR><TR><TD CLASS="l">65</TD><TD> {</TD></TR><TR CLASS="z"><TD CLASS="l">66</TD><TD> return valid;</TD></TR><TR><TD CLASS="l">67</TD><TD> }</TD></TR><TR><TD CLASS="l">68</TD><TD> </TD></TR><TR><TD CLASS="l">69</TD><TD> /**</TD></TR><TR><TD CLASS="l">70</TD><TD> * Add an error message.</TD></TR><TR><TD CLASS="l">71</TD><TD> * </TD></TR><TR><TD CLASS="l">72</TD><TD> * @param message The message to add.</TD></TR><TR><TD CLASS="l">73</TD><TD> * @param line The line location of the message.</TD></TR><TR><TD CLASS="l">74</TD><TD> * @param column The column location of the message.</TD></TR><TR><TD CLASS="l"><A NAME="3">75</A></TD><TD> * @param uri The URI of the file that contains the message.</TD></TR><TR><TD CLASS="l">76</TD><TD> */</TD></TR><TR><TD CLASS="l">77</TD><TD> public void addError(String message, int line, int column, String uri)</TD></TR><TR><TD CLASS="l">78</TD><TD> {</TD></TR><TR CLASS="z"><TD CLASS="l">79</TD><TD> addError(message, line, column, uri, null, null);</TD></TR><TR CLASS="z"><TD CLASS="l">80</TD><TD> } </TD></TR><TR><TD CLASS="l">81</TD><TD> </TD></TR><TR><TD CLASS="l">82</TD><TD> /**</TD></TR><TR><TD CLASS="l">83</TD><TD> * </TD></TR><TR><TD CLASS="l">84</TD><TD> * Add an error message.</TD></TR><TR><TD CLASS="l">85</TD><TD> * </TD></TR><TR><TD CLASS="l">86</TD><TD> * @param message The message to add.</TD></TR><TR><TD CLASS="l">87</TD><TD> * @param line The line location of the message.</TD></TR><TR><TD CLASS="l">88</TD><TD> * @param column The column location of the message.</TD></TR><TR><TD CLASS="l">89</TD><TD> * @param uri The URI of the file that contains the message.</TD></TR><TR><TD CLASS="l">90</TD><TD> * @param key The key for the message.</TD></TR><TR><TD CLASS="l"><A NAME="4">91</A></TD><TD> * @param messageArguments more information about the error</TD></TR><TR><TD CLASS="l">92</TD><TD> */</TD></TR><TR><TD CLASS="l">93</TD><TD> public void addError(String message, int line, int column, String uri, String key, Object[] messageArguments)</TD></TR><TR><TD CLASS="l">94</TD><TD> { </TD></TR><TR CLASS="z"><TD CLASS="l">95</TD><TD> if(addMessage(message, line, column, uri, SEV_ERROR, key, messageArguments))</TD></TR><TR><TD CLASS="l">96</TD><TD> {</TD></TR><TR CLASS="z"><TD CLASS="l">97</TD><TD> valid = false;</TD></TR><TR><TD CLASS="l">98</TD><TD> }</TD></TR><TR CLASS="z"><TD CLASS="l">99</TD><TD> }</TD></TR><TR><TD CLASS="l">100</TD><TD> </TD></TR><TR><TD CLASS="l">101</TD><TD> /**</TD></TR><TR><TD CLASS="l">102</TD><TD> * Add a warning message.</TD></TR><TR><TD CLASS="l">103</TD><TD> * </TD></TR><TR><TD CLASS="l">104</TD><TD> * @param message The string message of the warning.</TD></TR><TR><TD CLASS="l">105</TD><TD> * @param line The line location of the warning.</TD></TR><TR><TD CLASS="l">106</TD><TD> * @param column The column location of the warning.</TD></TR><TR><TD CLASS="l"><A NAME="6">107</A></TD><TD> * @param uri The URI of the file that contains the warning.</TD></TR><TR><TD CLASS="l">108</TD><TD> */</TD></TR><TR><TD CLASS="l">109</TD><TD> public void addWarning(String message, int line, int column, String uri)</TD></TR><TR><TD CLASS="l">110</TD><TD> {</TD></TR><TR CLASS="z"><TD CLASS="l">111</TD><TD> addWarning(message, line, column, uri, null, null);</TD></TR><TR CLASS="z"><TD CLASS="l">112</TD><TD> }</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> * </TD></TR><TR><TD CLASS="l">116</TD><TD> * Add an error message.</TD></TR><TR><TD CLASS="l">117</TD><TD> * </TD></TR><TR><TD CLASS="l">118</TD><TD> * @param message The message to add.</TD></TR><TR><TD CLASS="l">119</TD><TD> * @param line The line location of the message.</TD></TR><TR><TD CLASS="l">120</TD><TD> * @param column The column location of the message.</TD></TR><TR><TD CLASS="l">121</TD><TD> * @param uri The URI of the file that contains the message.</TD></TR><TR><TD CLASS="l">122</TD><TD> * @param key The key for the message.</TD></TR><TR><TD CLASS="l"><A NAME="7">123</A></TD><TD> * @param messageArguments more information about the error</TD></TR><TR><TD CLASS="l">124</TD><TD> */</TD></TR><TR><TD CLASS="l">125</TD><TD> public void addWarning(String message, int line, int column, String uri, String key, Object[] messageArguments)</TD></TR><TR><TD CLASS="l">126</TD><TD> { </TD></TR><TR CLASS="z"><TD CLASS="l">127</TD><TD> addMessage(message, line, column, uri, SEV_WARNING, key, messageArguments);</TD></TR><TR CLASS="z"><TD CLASS="l">128</TD><TD> }</TD></TR><TR><TD CLASS="l">129</TD><TD> </TD></TR><TR><TD CLASS="l">130</TD><TD> /**</TD></TR><TR><TD CLASS="l">131</TD><TD> * Add a message to the list. Return true if successful, false otherwise.</TD></TR><TR><TD CLASS="l">132</TD><TD> * </TD></TR><TR><TD CLASS="l">133</TD><TD> * @param message The message to add to the list.</TD></TR><TR><TD CLASS="l">134</TD><TD> * @param line The line location of the message.</TD></TR><TR><TD CLASS="l">135</TD><TD> * @param column The column location of the message.</TD></TR><TR><TD CLASS="l">136</TD><TD> * @param uri The URI of the file that contains the message.</TD></TR><TR><TD CLASS="l">137</TD><TD> * @param severity The severity of the message.</TD></TR><TR><TD CLASS="l">138</TD><TD> * @param key the Xerces error key for this error</TD></TR><TR><TD CLASS="l">139</TD><TD> * @param messageArguments more information on the error</TD></TR><TR><TD CLASS="l"><A NAME="5">140</A></TD><TD> * @return True if the message was successfully added, false otherwise.</TD></TR><TR><TD CLASS="l">141</TD><TD> */</TD></TR><TR><TD CLASS="l">142</TD><TD> private boolean addMessage(String message, int line, int column, String uri, int severity, String key, Object[] messageArguments)</TD></TR><TR><TD CLASS="l">143</TD><TD> {</TD></TR><TR CLASS="z"><TD CLASS="l">144</TD><TD> boolean successfullyAdded = false;</TD></TR><TR><TD CLASS="l">145</TD><TD> // If the message if null there is nothing to add.</TD></TR><TR CLASS="z"><TD CLASS="l">146</TD><TD> if(message == null)</TD></TR><TR><TD CLASS="l">147</TD><TD> {</TD></TR><TR CLASS="z"><TD CLASS="l">148</TD><TD> return successfullyAdded;</TD></TR><TR><TD CLASS="l">149</TD><TD> }</TD></TR><TR CLASS="z"><TD CLASS="l">150</TD><TD> String errorURI = normalize(uri);</TD></TR><TR CLASS="z"><TD CLASS="l">151</TD><TD> URL errorURL = null;</TD></TR><TR CLASS="z"><TD CLASS="l">152</TD><TD> if (errorURI != null)</TD></TR><TR><TD CLASS="l">153</TD><TD> {</TD></TR><TR><TD CLASS="l">154</TD><TD> try</TD></TR><TR><TD CLASS="l">155</TD><TD> {</TD></TR><TR CLASS="z"><TD CLASS="l">156</TD><TD> errorURL = new URL(errorURI);</TD></TR><TR CLASS="z"><TD CLASS="l">157</TD><TD> } catch (MalformedURLException e)</TD></TR><TR><TD CLASS="l">158</TD><TD> {</TD></TR><TR><TD CLASS="l">159</TD><TD> }</TD></TR><TR><TD CLASS="l">160</TD><TD> //errorURI = normalizeURI(errorURI);</TD></TR><TR><TD CLASS="l">161</TD><TD> }</TD></TR><TR><TD CLASS="l">162</TD><TD> //boolean doDialog = true;</TD></TR><TR CLASS="z"><TD CLASS="l">163</TD><TD> if (errorURL != null)</TD></TR><TR><TD CLASS="l">164</TD><TD> {</TD></TR><TR CLASS="z"><TD CLASS="l">165</TD><TD> successfullyAdded = true;</TD></TR><TR><TD CLASS="l">166</TD><TD> // Add to the appropriate list if nested error support is off or</TD></TR><TR><TD CLASS="l">167</TD><TD> // this message is for the current file.</TD></TR><TR CLASS="z"><TD CLASS="l">168</TD><TD> if (!WRAPPER_ERROR_SUPPORT_ENABLED || validating_file_url.sameFile(errorURL))</TD></TR><TR><TD CLASS="l">169</TD><TD> {</TD></TR><TR><TD CLASS="l">170</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">171</TD><TD> ValidationMessage valmes = new ValidationMessage(message, line,</TD></TR><TR CLASS="z"><TD CLASS="l">172</TD><TD> column, validating_file_uri, key, messageArguments);</TD></TR><TR CLASS="z"><TD CLASS="l">173</TD><TD> if (severity == SEV_ERROR)</TD></TR><TR><TD CLASS="l">174</TD><TD> {</TD></TR><TR CLASS="z"><TD CLASS="l">175</TD><TD> valmes.setSeverity(ValidationMessage.SEV_NORMAL);</TD></TR><TR CLASS="z"><TD CLASS="l">176</TD><TD> } else if (severity == SEV_WARNING)</TD></TR><TR><TD CLASS="l">177</TD><TD> {</TD></TR><TR CLASS="z"><TD CLASS="l">178</TD><TD> valmes.setSeverity(ValidationMessage.SEV_LOW);</TD></TR><TR><TD CLASS="l">179</TD><TD> }</TD></TR><TR CLASS="z"><TD CLASS="l">180</TD><TD> messages.add(valmes);</TD></TR><TR><TD CLASS="l">181</TD><TD> }</TD></TR><TR><TD CLASS="l">182</TD><TD> // If nested error support is enabled create a nested error.</TD></TR><TR CLASS="z"><TD CLASS="l">183</TD><TD> else if (WRAPPER_ERROR_SUPPORT_ENABLED)</TD></TR><TR><TD CLASS="l">184</TD><TD> {</TD></TR><TR CLASS="z"><TD CLASS="l">185</TD><TD> String nesteduri = errorURL.toExternalForm();</TD></TR><TR CLASS="z"><TD CLASS="l">186</TD><TD> ValidationMessage nestedmess = new ValidationMessage(message, line,</TD></TR><TR CLASS="z"><TD CLASS="l">187</TD><TD> column, nesteduri, key, messageArguments);</TD></TR><TR CLASS="z"><TD CLASS="l">188</TD><TD> if(severity == SEV_WARNING)</TD></TR><TR><TD CLASS="l">189</TD><TD> {</TD></TR><TR CLASS="z"><TD CLASS="l">190</TD><TD> nestedmess.setSeverity(ValidationMessage.SEV_LOW);</TD></TR><TR><TD CLASS="l">191</TD><TD> }</TD></TR><TR><TD CLASS="l">192</TD><TD> else</TD></TR><TR><TD CLASS="l">193</TD><TD> {</TD></TR><TR CLASS="z"><TD CLASS="l">194</TD><TD> nestedmess.setSeverity(ValidationMessage.SEV_NORMAL);</TD></TR><TR><TD CLASS="l">195</TD><TD> }</TD></TR><TR><TD CLASS="l">196</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">197</TD><TD> ValidationMessage container = (ValidationMessage) nestedMessages.get(nesteduri);</TD></TR><TR CLASS="z"><TD CLASS="l">198</TD><TD> if(container == null)</TD></TR><TR><TD CLASS="l">199</TD><TD> {</TD></TR><TR CLASS="z"><TD CLASS="l">200</TD><TD> container = new ValidationMessage(NLS.bind(XMLValidationMessages._UI_REF_FILE_ERROR_MESSAGE, new Object [] { nesteduri }), 1, 0, nesteduri);</TD></TR><TR><TD CLASS="l">201</TD><TD> </TD></TR><TR><TD CLASS="l">202</TD><TD> // Initially set the nested error to a warning. This will automatically be changed</TD></TR><TR><TD CLASS="l">203</TD><TD> // to an error if a nested message has a severity of error.</TD></TR><TR CLASS="z"><TD CLASS="l">204</TD><TD> container.setSeverity(ValidationMessage.SEV_LOW);</TD></TR><TR CLASS="z"><TD CLASS="l">205</TD><TD> nestedMessages.put(nesteduri, container);</TD></TR><TR CLASS="z"><TD CLASS="l">206</TD><TD> messages.add(container);</TD></TR><TR><TD CLASS="l">207</TD><TD> }</TD></TR><TR CLASS="z"><TD CLASS="l">208</TD><TD> container.addNestedMessage(nestedmess);</TD></TR><TR><TD CLASS="l">209</TD><TD> }</TD></TR><TR><TD CLASS="l">210</TD><TD> }</TD></TR><TR CLASS="z"><TD CLASS="l">211</TD><TD> return successfullyAdded;</TD></TR><TR><TD CLASS="l">212</TD><TD> }</TD></TR><TR><TD CLASS="l">213</TD><TD> </TD></TR><TR><TD CLASS="l">214</TD><TD> </TD></TR><TR><TD CLASS="l">215</TD><TD> /**</TD></TR><TR><TD CLASS="l">216</TD><TD> * Add a nested message to the validation information.</TD></TR><TR><TD CLASS="l">217</TD><TD> * </TD></TR><TR><TD CLASS="l">218</TD><TD> * @param message The string message of the validation message.</TD></TR><TR><TD CLASS="l">219</TD><TD> * @param line The line location of the validation message.</TD></TR><TR><TD CLASS="l">220</TD><TD> * @param column The column location of the validation message.</TD></TR><TR><TD CLASS="l">221</TD><TD> * @param uri The URI of the validation message.</TD></TR><TR><TD CLASS="l">222</TD><TD> * @param severity The severity of the validation message.</TD></TR><TR><TD CLASS="l">223</TD><TD> */</TD></TR><TR><TD CLASS="l">224</TD><TD>// public void addNestedMessage(String message, int line, int column, String uri, int severity)</TD></TR><TR><TD CLASS="l">225</TD><TD>// {</TD></TR><TR><TD CLASS="l">226</TD><TD>// ValidationMessage nestedmess = new ValidationMessage(message, line, column, uri);</TD></TR><TR><TD CLASS="l">227</TD><TD>// if(severity == SEV_WARNING)</TD></TR><TR><TD CLASS="l">228</TD><TD>// {</TD></TR><TR><TD CLASS="l">229</TD><TD>// nestedmess.setSeverity(ValidationMessage.SEV_LOW);</TD></TR><TR><TD CLASS="l">230</TD><TD>// }</TD></TR><TR><TD CLASS="l">231</TD><TD>// else</TD></TR><TR><TD CLASS="l">232</TD><TD>// {</TD></TR><TR><TD CLASS="l">233</TD><TD>// nestedmess.setSeverity(ValidationMessage.SEV_NORMAL);</TD></TR><TR><TD CLASS="l">234</TD><TD>// }</TD></TR><TR><TD CLASS="l">235</TD><TD>// ValidationMessage container = (ValidationMessage)nestedMessages.get(uri);</TD></TR><TR><TD CLASS="l">236</TD><TD>// if(container == null)</TD></TR><TR><TD CLASS="l">237</TD><TD>// {</TD></TR><TR><TD CLASS="l">238</TD><TD>// container = new ValidationMessage(XMLCoreValidationPlugin.getResourceString(_UI_REF_FILE_ERROR_MESSAGE, uri), 1, 0, validating_file_uri);</TD></TR><TR><TD CLASS="l">239</TD><TD>// // Initially set the nested error to a warning. This will automatically be changed</TD></TR><TR><TD CLASS="l">240</TD><TD>// // to an error if a nested message has a severity of error.</TD></TR><TR><TD CLASS="l">241</TD><TD>// container.setSeverity(ValidationMessage.SEV_LOW);</TD></TR><TR><TD CLASS="l">242</TD><TD>// nestedMessages.put(uri, container);</TD></TR><TR><TD CLASS="l">243</TD><TD>// messages.add(container);</TD></TR><TR><TD CLASS="l">244</TD><TD>// }</TD></TR><TR><TD CLASS="l">245</TD><TD>// container.addNestedMessage(nestedmess);</TD></TR><TR><TD CLASS="l">246</TD><TD>// }</TD></TR><TR><TD CLASS="l">247</TD><TD> </TD></TR><TR><TD CLASS="l">248</TD><TD> /**</TD></TR><TR><TD CLASS="l"><A NAME="a">249</A></TD><TD> * @see org.eclipse.wsdl.validate.ValidationReport#getValidationMessages()</TD></TR><TR><TD CLASS="l">250</TD><TD> */</TD></TR><TR><TD CLASS="l">251</TD><TD> public ValidationMessage[] getValidationMessages()</TD></TR><TR><TD CLASS="l">252</TD><TD> {</TD></TR><TR CLASS="z"><TD CLASS="l">253</TD><TD> return (ValidationMessage[])messages.toArray(new ValidationMessage[messages.size()]);</TD></TR><TR><TD CLASS="l"><A NAME="9">254</A></TD><TD> }</TD></TR><TR><TD CLASS="l">255</TD><TD> </TD></TR><TR><TD CLASS="l">256</TD><TD> public HashMap getNestedMessages()</TD></TR><TR><TD CLASS="l">257</TD><TD> {</TD></TR><TR CLASS="z"><TD CLASS="l">258</TD><TD> return nestedMessages;</TD></TR><TR><TD CLASS="l">259</TD><TD> }</TD></TR><TR><TD CLASS="l">260</TD><TD> </TD></TR><TR><TD CLASS="l">261</TD><TD> /**</TD></TR><TR><TD CLASS="l">262</TD><TD> * Put the URI in a standard format.</TD></TR><TR><TD CLASS="l">263</TD><TD> * </TD></TR><TR><TD CLASS="l">264</TD><TD> * @param uri The URI to put into a standard format.</TD></TR><TR><TD CLASS="l">265</TD><TD> * @return The standard format of the URI.</TD></TR><TR><TD CLASS="l">266</TD><TD> */</TD></TR><TR><TD CLASS="l">267</TD><TD> private String normalize(String uri)</TD></TR><TR><TD CLASS="l">268</TD><TD> {</TD></TR><TR><TD CLASS="l">269</TD><TD>// if(uri.startsWith("platform:"))</TD></TR><TR><TD CLASS="l">270</TD><TD>// {</TD></TR><TR><TD CLASS="l">271</TD><TD>// try</TD></TR><TR><TD CLASS="l">272</TD><TD>// {</TD></TR><TR><TD CLASS="l">273</TD><TD>// uri = Platform.resolve(new URL(uri)).toString();</TD></TR><TR><TD CLASS="l">274</TD><TD>// }</TD></TR><TR><TD CLASS="l"><A NAME="c">275</A></TD><TD>// catch(Exception e)</TD></TR><TR><TD CLASS="l">276</TD><TD>// {</TD></TR><TR><TD CLASS="l">277</TD><TD>// }</TD></TR><TR><TD CLASS="l">278</TD><TD>// }</TD></TR><TR CLASS="z"><TD CLASS="l">279</TD><TD> uri = uri.replaceAll("%20"," "); //$NON-NLS-1$ //$NON-NLS-2$</TD></TR><TR CLASS="z"><TD CLASS="l">280</TD><TD> uri = uri.replaceAll("%5E", "^"); //$NON-NLS-1$ //$NON-NLS-2$</TD></TR><TR CLASS="z"><TD CLASS="l">281</TD><TD> uri = uri.replace('\\','/');</TD></TR><TR><TD CLASS="l">282</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">283</TD><TD> return uri;</TD></TR><TR><TD CLASS="l">284</TD><TD> }</TD></TR><TR><TD CLASS="l">285</TD><TD> </TD></TR><TR><TD CLASS="l">286</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="230.html">org.eclipse.wst.xml.core.internal.validation.core</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>
\ No newline at end of file |