EMMA Coverage Report (generated Thu Jan 03 04:54:40 CET 2013)
[all classes][org.jomc.tools.model]

COVERAGE SUMMARY FOR SOURCE FILE [SourceSectionsType.java]

nameclass, %method, %block, %line, %
SourceSectionsType.java100% (1/1)86%  (6/7)73%  (101/139)78%  (28/36)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SourceSectionsType100% (1/1)86%  (6/7)73%  (101/139)78%  (28/36)
SourceSectionsType (SourceSectionsType): void 0%   (0/1)0%   (0/19)0%   (0/6)
getSourceSection (String): SourceSectionType 100% (1/1)58%  (7/12)67%  (2/3)
copySourceSection (List, List): void 100% (1/1)64%  (25/39)88%  (7/8)
SourceSectionsType (): void 100% (1/1)100% (3/3)100% (2/2)
clone (): SourceSectionsType 100% (1/1)100% (17/17)100% (5/5)
getSourceSection (): List 100% (1/1)100% (11/11)100% (3/3)
getSourceSection (SourceSectionsType, String): SourceSectionType 100% (1/1)100% (38/38)100% (9/9)

1//
2// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2 
3// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
4// Any modifications to this file will be lost upon recompilation of the source schema. 
5// Generated on: 2013.01.03 at 05:11:05 AM CET 
6//
7 
8 
9package org.jomc.tools.model;
10 
11import java.util.ArrayList;
12import java.util.Iterator;
13import java.util.List;
14import javax.annotation.Generated;
15import javax.xml.bind.annotation.XmlAccessType;
16import javax.xml.bind.annotation.XmlAccessorType;
17import javax.xml.bind.annotation.XmlElement;
18import javax.xml.bind.annotation.XmlType;
19 
20 
21/**
22 * List of source sections.
23 * 
24 * <p>Java class for SourceSectionsType complex type.
25 * 
26 * <p>The following schema fragment specifies the expected content contained within this class.
27 * 
28 * <pre>
29 * &lt;complexType name="SourceSectionsType">
30 *   &lt;complexContent>
31 *     &lt;extension base="{http://jomc.org/tools/model}ToolsType">
32 *       &lt;sequence>
33 *         &lt;element ref="{http://jomc.org/tools/model}source-section" maxOccurs="unbounded" minOccurs="0"/>
34 *       &lt;/sequence>
35 *     &lt;/extension>
36 *   &lt;/complexContent>
37 * &lt;/complexType>
38 * </pre>
39 * 
40 * 
41 */
42@XmlAccessorType(XmlAccessType.FIELD)
43@XmlType(name = "SourceSectionsType", namespace = "http://jomc.org/tools/model", propOrder = {
44    "sourceSection"
45})
46@Generated(value = "com.sun.tools.xjc.Driver", date = "2013-01-03T05:11:05+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
47public class SourceSectionsType
48    extends ToolsType
49    implements Cloneable
50{
51 
52    @XmlElement(name = "source-section", namespace = "http://jomc.org/tools/model")
53    @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-01-03T05:11:05+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
54    protected List<SourceSectionType> sourceSection;
55 
56    /**
57     * Creates a new {@code SourceSectionsType} instance.
58     * 
59     */
60    public SourceSectionsType() {
61        // CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000
62        super();
63    }
64 
65    /**
66     * Creates a new {@code SourceSectionsType} instance by deeply copying a given {@code SourceSectionsType} instance.
67     * 
68     * 
69     * @param o
70     *     The instance to copy.
71     * @throws NullPointerException
72     *     if {@code o} is {@code null}.
73     */
74    public SourceSectionsType(final SourceSectionsType o) {
75        // CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000
76        super(o);
77        if (o == null) {
78            throw new NullPointerException("Cannot create a copy of 'SourceSectionsType' from 'null'.");
79        }
80        // 'SourceSection' collection.
81        if (o.sourceSection!= null) {
82            copySourceSection(o.getSourceSection(), this.getSourceSection());
83        }
84    }
85 
86    /**
87     * Gets the value of the sourceSection property.
88     * 
89     * <p>
90     * This accessor method returns a reference to the live list,
91     * not a snapshot. Therefore any modification you make to the
92     * returned list will be present inside the JAXB object.
93     * This is why there is not a <CODE>set</CODE> method for the sourceSection property.
94     * 
95     * <p>
96     * For example, to add a new item, do as follows:
97     * <pre>
98     *    getSourceSection().add(newItem);
99     * </pre>
100     * 
101     * 
102     * <p>
103     * Objects of the following type(s) are allowed in the list
104     * {@link SourceSectionType }
105     * 
106     * 
107     */
108    @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-01-03T05:11:05+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
109    public List<SourceSectionType> getSourceSection() {
110        if (sourceSection == null) {
111            sourceSection = new ArrayList<SourceSectionType>();
112        }
113        return this.sourceSection;
114    }
115 
116    /**
117     * Copies all values of property {@code SourceSection} deeply.
118     * 
119     * @param source
120     *     The source to copy from.
121     * @param target
122     *     The target to copy {@code source} to.
123     * @throws NullPointerException
124     *     if {@code target} is {@code null}.
125     */
126    @SuppressWarnings("unchecked")
127    @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-01-03T05:11:05+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
128    private static void copySourceSection(final List<SourceSectionType> source, final List<SourceSectionType> target) {
129        // CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000
130        if ((source!= null)&&(!source.isEmpty())) {
131            for (final Iterator<?> it = source.iterator(); it.hasNext(); ) {
132                final Object next = it.next();
133                if (next instanceof SourceSectionType) {
134                    // CClassInfo: org.jomc.tools.model.SourceSectionType
135                    target.add(((SourceSectionType) next).clone());
136                    continue;
137                }
138                // Please report this at https://apps.sourceforge.net/mantisbt/ccxjc/
139                throw new AssertionError((("Unexpected instance '"+ next)+"' for property 'SourceSection' of class 'org.jomc.tools.model.SourceSectionsType'."));
140            }
141        }
142    }
143 
144    /**
145     * Creates and returns a deep copy of this object.
146     * 
147     * 
148     * @return
149     *     A deep copy of this object.
150     */
151    @Override
152    @Generated(value = "com.sun.tools.xjc.Driver", date = "2013-01-03T05:11:05+01:00", comments = "JAXB RI vhudson-jaxb-ri-2.1-2")
153    public SourceSectionsType clone() {
154        {
155            // CC-XJC Version 2.0.1 Build 2012-03-02T12:09:12+0000
156            final SourceSectionsType clone = ((SourceSectionsType) super.clone());
157            // 'SourceSection' collection.
158            if (this.sourceSection!= null) {
159                clone.sourceSection = null;
160                copySourceSection(this.getSourceSection(), clone.getSourceSection());
161            }
162            return clone;
163        }
164    }
165    
166    /**
167     * Gets a section for a given name recursively from the list of sections.
168     *
169     * @param name The name of the section to return.
170     *
171     * @return The first matching section or {@code null}, if no such section is found.
172     *
173     * @throws NullPointerException if {@code name} is {@code null}.
174     *
175     * @see #getSourceSection()
176     * @see SourceSectionType#getName()
177     * @see SourceSectionType#getSourceSections()
178     */
179    public SourceSectionType getSourceSection( final String name )
180    {
181        if ( name == null )
182        {
183            throw new NullPointerException( "name" );
184        }
185 
186        return this.getSourceSection( this, name );
187    }
188 
189    private SourceSectionType getSourceSection( final SourceSectionsType sourceSectionsType, final String name )
190    {
191        if ( sourceSectionsType != null )
192        {
193            for ( int i = 0, s0 = sourceSectionsType.getSourceSection().size(); i < s0; i++ )
194            {
195                final SourceSectionType s = sourceSectionsType.getSourceSection().get( i );
196 
197                if ( name.equals( s.getName() ) )
198                {
199                    return s;
200                }
201 
202                final SourceSectionType sourceSectionType = this.getSourceSection( s.getSourceSections(), name );
203                if ( sourceSectionType != null )
204                {
205                    return sourceSectionType;
206                }
207            }
208        }
209 
210        return null;
211    }
212      
213}

[all classes][org.jomc.tools.model]
EMMA 2.1.5320 (stable) (C) Vladimir Roubtsov