blob: ff4f7885e2fc31a69f836277052caa49b3cfe9aa [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="ab.html">org.eclipse.wst.xml.core.internal.propagate</A>]</TD></TR></TABLE><H2>COVERAGE SUMMARY FOR SOURCE FILE [<SPAN CLASS="in">PropagatingAdapterFactoryImpl.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>PropagatingAdapterFactoryImpl.java</TD><TD>100% (1/1)</TD><TD CLASS="h">62%  (5/8)</TD><TD CLASS="h">38%  (42/112)</TD><TD CLASS="h">43%  (11.7/27)</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">PropagatingAdapterFactoryImpl</A></TD><TD>100% (1/1)</TD><TD CLASS="h">62%  (5/8)</TD><TD CLASS="h">38%  (42/112)</TD><TD CLASS="h">43%  (11.7/27)</TD></TR><TR><TD CLASS="f"><A HREF="#1">addContributedFactories (INodeAdapterFactory): void</A></TD><TD> </TD><TD CLASS="h">0%   (0/1)</TD><TD CLASS="h">0%   (0/9)</TD><TD CLASS="h">0%   (0/3)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#2">copy (): INodeAdapterFactory</A></TD><TD> </TD><TD CLASS="h">0%   (0/1)</TD><TD CLASS="h">0%   (0/34)</TD><TD CLASS="h">0%   (0/8)</TD></TR><TR><TD CLASS="f"><A HREF="#3">setContributedFactories (ArrayList): void</A></TD><TD> </TD><TD CLASS="h">0%   (0/1)</TD><TD CLASS="h">0%   (0/4)</TD><TD CLASS="h">0%   (0/2)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#4">getAdapterInstance (): PropagatingAdapter</A></TD><TD> </TD><TD>100% (1/1)</TD><TD CLASS="h">45%  (14/31)</TD><TD CLASS="h">67%  (4/6)</TD></TR><TR><TD CLASS="f"><A HREF="#0">PropagatingAdapterFactoryImpl (): void</A></TD><TD> </TD><TD>100% (1/1)</TD><TD CLASS="h">68%  (13/19)</TD><TD>84%  (1.7/2)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#6">PropagatingAdapterFactoryImpl (Object, boolean): void</A></TD><TD> </TD><TD>100% (1/1)</TD><TD>100% (8/8)</TD><TD>100% (3/3)</TD></TR><TR><TD CLASS="f"><A HREF="#7">createAdapter (INodeNotifier): INodeAdapter</A></TD><TD> </TD><TD>100% (1/1)</TD><TD>100% (3/3)</TD><TD>100% (1/1)</TD></TR><TR CLASS="o"><TD CLASS="f"><A HREF="#8">release (): void</A></TD><TD> </TD><TD>100% (1/1)</TD><TD>100% (4/4)</TD><TD>100% (2/2)</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> *     Jens Lukowski/Innoopract - initial renaming/restructuring</TD></TR><TR><TD CLASS="l">11</TD><TD> *     </TD></TR><TR><TD CLASS="l">12</TD><TD> *******************************************************************************/</TD></TR><TR><TD CLASS="l">13</TD><TD>package org.eclipse.wst.xml.core.internal.propagate;</TD></TR><TR><TD CLASS="l">14</TD><TD> </TD></TR><TR><TD CLASS="l">15</TD><TD> </TD></TR><TR><TD CLASS="l">16</TD><TD>import java.util.ArrayList;</TD></TR><TR><TD CLASS="l">17</TD><TD>import java.util.Iterator;</TD></TR><TR><TD CLASS="l">18</TD><TD>import java.util.List;</TD></TR><TR><TD CLASS="l">19</TD><TD> </TD></TR><TR><TD CLASS="l">20</TD><TD>import org.eclipse.wst.sse.core.internal.PropagatingAdapter;</TD></TR><TR><TD CLASS="l">21</TD><TD>import org.eclipse.wst.sse.core.internal.PropagatingAdapterFactory;</TD></TR><TR><TD CLASS="l">22</TD><TD>import org.eclipse.wst.sse.core.internal.provisional.AbstractAdapterFactory;</TD></TR><TR><TD CLASS="l">23</TD><TD>import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;</TD></TR><TR><TD CLASS="l">24</TD><TD>import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;</TD></TR><TR><TD CLASS="l">25</TD><TD>import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;</TD></TR><TR><TD CLASS="l">26</TD><TD> </TD></TR><TR><TD CLASS="l">27</TD><TD> </TD></TR><TR><TD CLASS="l">28</TD><TD>/**</TD></TR><TR><TD CLASS="l">29</TD><TD> * The PropagatingAdapterFactory is part of the &#34;adapt on create&#34; mechanism. A</TD></TR><TR><TD CLASS="l">30</TD><TD> * PropagatingAdapter, once added to a node, will cause proagating adapters to</TD></TR><TR><TD CLASS="l">31</TD><TD> * be created for all child nodes. A side effect of creating a</TD></TR><TR><TD CLASS="l">32</TD><TD> * PropagatingAdapter for a node is that is is also creates adapters for and</TD></TR><TR><TD CLASS="l">33</TD><TD> * adapts the Node for all other registered 'create on adapt' Adapters. This</TD></TR><TR><TD CLASS="l">34</TD><TD> * other adapters are registered by registering their factories via plugin</TD></TR><TR><TD CLASS="l">35</TD><TD> * extension point.</TD></TR><TR><TD CLASS="l">36</TD><TD> */</TD></TR><TR><TD CLASS="l">37</TD><TD>public class PropagatingAdapterFactoryImpl extends AbstractAdapterFactory implements PropagatingAdapterFactory {</TD></TR><TR><TD CLASS="l">38</TD><TD> </TD></TR><TR><TD CLASS="l">39</TD><TD>        private PropagatingAdapter fAdapterInstance;</TD></TR><TR CLASS="c"><TD CLASS="l">40</TD><TD>        private List fContributedFactories = null;</TD></TR><TR><TD CLASS="l">41</TD><TD> </TD></TR><TR><TD CLASS="l"><A NAME="0">42</A></TD><TD>        /**</TD></TR><TR><TD CLASS="l">43</TD><TD>         * PropagatingAdapterFactory constructor comment.</TD></TR><TR><TD CLASS="l">44</TD><TD>         */</TD></TR><TR><TD CLASS="l">45</TD><TD>        public PropagatingAdapterFactoryImpl() {</TD></TR><TR CLASS="p"><TD CLASS="l" TITLE="68% line coverage (13 out of 19 instructions)"><A NAME="6">46</A></TD><TD TITLE="68% line coverage (13 out of 19 instructions)">                this(PropagatingAdapter.class, true);</TD></TR><TR CLASS="c"><TD CLASS="l">47</TD><TD>        }</TD></TR><TR><TD CLASS="l">48</TD><TD> </TD></TR><TR><TD CLASS="l">49</TD><TD>        protected PropagatingAdapterFactoryImpl(Object adapterKey, boolean registerAdapters) { // ,</TD></TR><TR CLASS="c"><TD CLASS="l"><A NAME="1">50</A></TD><TD>                super(adapterKey, registerAdapters);</TD></TR><TR CLASS="c"><TD CLASS="l">51</TD><TD>        }</TD></TR><TR><TD CLASS="l">52</TD><TD> </TD></TR><TR><TD CLASS="l">53</TD><TD>        public void addContributedFactories(INodeAdapterFactory factory) {</TD></TR><TR CLASS="z"><TD CLASS="l">54</TD><TD>                if (fContributedFactories != null) {</TD></TR><TR CLASS="z"><TD CLASS="l">55</TD><TD>                        fContributedFactories.add(factory);</TD></TR><TR><TD CLASS="l">56</TD><TD>                }</TD></TR><TR><TD CLASS="l">57</TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">58</TD><TD>        }</TD></TR><TR><TD CLASS="l">59</TD><TD> </TD></TR><TR><TD CLASS="l">60</TD><TD>        /**</TD></TR><TR><TD CLASS="l">61</TD><TD>         * createAdapter method comment.</TD></TR><TR><TD CLASS="l"><A NAME="7">62</A></TD><TD>         */</TD></TR><TR><TD CLASS="l">63</TD><TD>        protected INodeAdapter createAdapter(INodeNotifier target) {</TD></TR><TR><TD CLASS="l">64</TD><TD>                // every notifier get's one of these</TD></TR><TR><TD CLASS="l">65</TD><TD>                // (and the same instance of it)</TD></TR><TR CLASS="c"><TD CLASS="l">66</TD><TD>                return getAdapterInstance();</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>         * Gets the adapterInstance.</TD></TR><TR><TD CLASS="l"><A NAME="4">71</A></TD><TD>         * </TD></TR><TR><TD CLASS="l">72</TD><TD>         * @return Returns a PropagatingAdapter</TD></TR><TR><TD CLASS="l">73</TD><TD>         */</TD></TR><TR><TD CLASS="l">74</TD><TD>        private PropagatingAdapter getAdapterInstance() {</TD></TR><TR CLASS="c"><TD CLASS="l">75</TD><TD>                if (fAdapterInstance == null) {</TD></TR><TR CLASS="c"><TD CLASS="l">76</TD><TD>                        fAdapterInstance = new PropagatingAdapterImpl();</TD></TR><TR CLASS="c"><TD CLASS="l">77</TD><TD>                        if (fContributedFactories != null) {</TD></TR><TR CLASS="z"><TD CLASS="l">78</TD><TD>                                for (int i = 0; i &lt; fContributedFactories.size(); i++)</TD></TR><TR CLASS="z"><TD CLASS="l">79</TD><TD>                                        fAdapterInstance.addAdaptOnCreateFactory((PropagatingAdapterFactory) fContributedFactories.get(i));</TD></TR><TR><TD CLASS="l">80</TD><TD>                        }</TD></TR><TR><TD CLASS="l">81</TD><TD>                }</TD></TR><TR CLASS="c"><TD CLASS="l">82</TD><TD>                return fAdapterInstance;</TD></TR><TR><TD CLASS="l"><A NAME="8">83</A></TD><TD>        }</TD></TR><TR><TD CLASS="l">84</TD><TD> </TD></TR><TR><TD CLASS="l">85</TD><TD>        public void release() {</TD></TR><TR><TD CLASS="l">86</TD><TD>                // give the adapter instance a chance to release its factories</TD></TR><TR CLASS="c"><TD CLASS="l">87</TD><TD>                getAdapterInstance().release();</TD></TR><TR><TD CLASS="l"><A NAME="3">88</A></TD><TD> </TD></TR><TR CLASS="c"><TD CLASS="l">89</TD><TD>        }</TD></TR><TR><TD CLASS="l">90</TD><TD> </TD></TR><TR><TD CLASS="l">91</TD><TD>        public void setContributedFactories(ArrayList list) {</TD></TR><TR CLASS="z"><TD CLASS="l">92</TD><TD>                fContributedFactories = list;</TD></TR><TR><TD CLASS="l"><A NAME="2">93</A></TD><TD> </TD></TR><TR CLASS="z"><TD CLASS="l">94</TD><TD>        }</TD></TR><TR><TD CLASS="l">95</TD><TD> </TD></TR><TR><TD CLASS="l">96</TD><TD>        public INodeAdapterFactory copy() {</TD></TR><TR CLASS="z"><TD CLASS="l">97</TD><TD>                PropagatingAdapterFactory clonedInstance = new PropagatingAdapterFactoryImpl(getAdapterKey(), isShouldRegisterAdapter());</TD></TR><TR><TD CLASS="l">98</TD><TD>                // clone this adapters specific list of adapter factories too</TD></TR><TR CLASS="z"><TD CLASS="l">99</TD><TD>                if (fContributedFactories != null) {</TD></TR><TR><TD CLASS="l">100</TD><TD>                        </TD></TR><TR CLASS="z"><TD CLASS="l">101</TD><TD>                        Iterator iterator = fContributedFactories.iterator();</TD></TR><TR CLASS="z"><TD CLASS="l">102</TD><TD>                        clonedInstance.setContributedFactories(new ArrayList());</TD></TR><TR CLASS="z"><TD CLASS="l">103</TD><TD>                        while (iterator.hasNext()) {</TD></TR><TR CLASS="z"><TD CLASS="l">104</TD><TD>                                INodeAdapterFactory existingFactory = (INodeAdapterFactory) iterator.next();</TD></TR><TR CLASS="z"><TD CLASS="l">105</TD><TD>                                clonedInstance.addContributedFactories(existingFactory.copy());</TD></TR><TR><TD CLASS="l">106</TD><TD>                        }</TD></TR><TR><TD CLASS="l">107</TD><TD>                }</TD></TR><TR CLASS="z"><TD CLASS="l">108</TD><TD>                return clonedInstance;</TD></TR><TR><TD CLASS="l">109</TD><TD>        }</TD></TR><TR><TD CLASS="l">110</TD><TD> </TD></TR><TR><TD CLASS="l">111</TD><TD>        </TD></TR><TR><TD CLASS="l">112</TD><TD> </TD></TR><TR><TD CLASS="l">113</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="ab.html">org.eclipse.wst.xml.core.internal.propagate</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>