Clover icon

sunshower-sdk

  1. Project Clover database Sat May 12 2018 05:15:40 UTC
  2. Package io.sunshower.sdk.v1.model.core.element

File Element.java

 

Coverage histogram

../../../../../../../img/srcFileCovDistChart4.png
34% of files have more coverage

Code metrics

0
1
2
1
34
25
2
2
0.5
2
1

Classes

Class Line # Actions
Element 19 1 2
0.3333333433.3%
 

Contributing tests

This file is covered by 3 tests. .

Source view

1    package io.sunshower.sdk.v1.model.core.element;
2   
3    import io.sunshower.common.rs.ClassAdapter;
4    import io.sunshower.common.rs.TypeAttributeClassExtractor;
5    import lombok.Getter;
6    import lombok.Setter;
7    import org.eclipse.persistence.oxm.annotations.XmlClassExtractor;
8    import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorNode;
9   
10    import javax.xml.bind.annotation.XmlAttribute;
11    import javax.xml.bind.annotation.XmlRootElement;
12    import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
13   
14    @Getter
15    @Setter
16    @XmlRootElement(name = "element")
17    @XmlDiscriminatorNode("@type")
18    @XmlClassExtractor(TypeAttributeClassExtractor.class)
 
19    public class Element<T> {
20   
21   
22    @XmlAttribute(name = "type")
23    @XmlJavaTypeAdapter(ClassAdapter.class)
24    protected Class<T> type;
25   
 
26  9 toggle protected Element() {
27   
28    }
29   
 
30  0 toggle protected Element(Class<T> type) {
31  0 setType(type);
32    }
33   
34    }