Revision 4ac5c0e4
Added by Andreas Müller over 6 years ago
cdmlib-commons/src/main/java/eu/etaxonomy/cdm/common/media/ImageInfo.java | ||
---|---|---|
29 | 29 |
/** |
30 | 30 |
* @author k.luther |
31 | 31 |
* @date 27.11.2009 |
32 |
* |
|
33 | 32 |
*/ |
34 | 33 |
public class ImageInfo extends MediaInfo { |
35 | 34 |
private static Logger logger = Logger.getLogger(ImageInfo.class); |
cdmlib-commons/src/main/java/eu/etaxonomy/cdm/common/media/MediaInfo.java | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Copyright (C) 2007 EDIT |
3 |
* European Distributed Institute of Taxonomy
|
|
3 |
* European Distributed Institute of Taxonomy |
|
4 | 4 |
* http://www.e-taxonomy.eu |
5 |
*
|
|
5 |
* |
|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
... | ... | |
12 | 12 |
import org.apache.log4j.Logger; |
13 | 13 |
|
14 | 14 |
/** |
15 |
*
|
|
15 |
* |
|
16 | 16 |
* @author n.hoffmann |
17 | 17 |
* @created 13.11.2008 |
18 |
* @version 1.0 |
|
19 | 18 |
*/ |
20 | 19 |
public abstract class MediaInfo { |
21 | 20 |
@SuppressWarnings("unused") |
... | ... | |
24 | 23 |
private String mimeType; |
25 | 24 |
private long length; |
26 | 25 |
private String suffix; |
27 |
|
|
26 |
|
|
28 | 27 |
|
29 | 28 |
public void setMimeType(String mimeType) { |
30 | 29 |
this.mimeType = mimeType; |
31 | 30 |
} |
32 |
|
|
33 | 31 |
public String getMimeType() { |
34 | 32 |
return mimeType; |
35 | 33 |
} |
... | ... | |
37 | 35 |
public void setFormatName(String formatName) { |
38 | 36 |
this.formatName = formatName; |
39 | 37 |
} |
40 |
|
|
41 | 38 |
public String getFormatName() { |
42 | 39 |
return formatName; |
43 | 40 |
} |
... | ... | |
45 | 42 |
public void setLength(long length) { |
46 | 43 |
this.length = length; |
47 | 44 |
} |
48 |
|
|
49 | 45 |
public long getLength() { |
50 | 46 |
return length; |
51 | 47 |
} |
... | ... | |
53 | 49 |
public void setSuffix(String suffix) { |
54 | 50 |
this.suffix = suffix; |
55 | 51 |
} |
56 |
|
|
57 | 52 |
public String getSuffix() { |
58 | 53 |
return suffix; |
59 | 54 |
} |
60 |
|
|
55 |
|
|
61 | 56 |
} |
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/TermBase.java | ||
---|---|---|
82 | 82 |
@OneToMany(fetch=FetchType.EAGER, orphanRemoval=true) |
83 | 83 |
@Cascade( { CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE}) |
84 | 84 |
// @IndexedEmbedded no need for embedding since we are using the DefinedTermBaseClassBridge |
85 |
private Set<Representation> representations = new HashSet<Representation>();
|
|
85 |
private Set<Representation> representations = new HashSet<>(); |
|
86 | 86 |
|
87 | 87 |
//******************* CONSTRUCTOR *************************************/ |
88 | 88 |
|
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/media/AudioFile.java | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Copyright (C) 2007 EDIT |
3 |
* European Distributed Institute of Taxonomy
|
|
3 |
* European Distributed Institute of Taxonomy |
|
4 | 4 |
* http://www.e-taxonomy.eu |
5 |
*
|
|
5 |
* |
|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
... | ... | |
11 | 11 |
|
12 | 12 |
import java.net.URI; |
13 | 13 |
|
14 |
import org.apache.log4j.Logger; |
|
15 |
import org.hibernate.envers.Audited; |
|
16 |
|
|
17 |
import javax.persistence.*; |
|
14 |
import javax.persistence.Entity; |
|
18 | 15 |
import javax.xml.bind.annotation.XmlAccessType; |
19 | 16 |
import javax.xml.bind.annotation.XmlAccessorType; |
20 | 17 |
import javax.xml.bind.annotation.XmlElement; |
21 | 18 |
import javax.xml.bind.annotation.XmlRootElement; |
22 | 19 |
import javax.xml.bind.annotation.XmlType; |
23 | 20 |
|
21 |
import org.apache.log4j.Logger; |
|
22 |
import org.hibernate.envers.Audited; |
|
23 |
|
|
24 | 24 |
/** |
25 | 25 |
* @author m.doering |
26 |
* @version 1.0 |
|
27 | 26 |
* @created 08-Nov-2007 13:06:11 |
28 | 27 |
*/ |
29 | 28 |
@XmlAccessorType(XmlAccessType.FIELD) |
... | ... | |
36 | 35 |
public class AudioFile extends MediaRepresentationPart { |
37 | 36 |
private static final long serialVersionUID = 2327736023969971196L; |
38 | 37 |
private static final Logger logger = Logger.getLogger(AudioFile.class); |
39 |
|
|
38 |
|
|
40 | 39 |
//length of recording in seconds |
41 | 40 |
@XmlElement(name = "Duration") |
42 | 41 |
private int duration; |
43 | 42 |
|
43 |
|
|
44 |
// *************** FACTORY METHOD *********************************/ |
|
45 |
|
|
44 | 46 |
public static AudioFile NewInstance(URI uri, Integer size){ |
45 | 47 |
logger.debug("NewInstance"); |
46 | 48 |
return new AudioFile(uri, size); |
47 | 49 |
} |
48 |
|
|
49 |
/** |
|
50 |
* Factory method |
|
51 |
* @return |
|
52 |
*/ |
|
53 | 50 |
public static AudioFile NewInstance(){ |
54 | 51 |
return new AudioFile(); |
55 | 52 |
} |
56 |
|
|
57 |
/** |
|
58 |
* Constructor |
|
59 |
*/ |
|
53 |
|
|
54 |
// ********************** CONSTRUCTOR ***************************/ |
|
60 | 55 |
protected AudioFile() { |
61 | 56 |
super(); |
62 | 57 |
} |
63 |
|
|
64 |
/** |
|
65 |
* Constructor |
|
66 |
*/ |
|
58 |
|
|
67 | 59 |
protected AudioFile(URI uri, Integer size) { |
68 | 60 |
super(uri, size); |
69 | 61 |
} |
70 |
|
|
62 |
|
|
63 |
// ******************** GETTER / SETTER *************************/ |
|
71 | 64 |
public int getDuration(){ |
72 | 65 |
return this.duration; |
73 | 66 |
} |
74 |
|
|
75 |
/** |
|
76 |
* |
|
77 |
* @param duration duration |
|
78 |
*/ |
|
79 | 67 |
public void setDuration(int duration){ |
80 | 68 |
this.duration = duration; |
81 | 69 |
} |
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/media/MediaRepresentationPart.java | ||
---|---|---|
69 | 69 |
@Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE}) |
70 | 70 |
private MediaRepresentation mediaRepresentation; |
71 | 71 |
|
72 |
/** |
|
73 |
* Factory method |
|
74 |
* |
|
75 |
* @return |
|
76 |
*/ |
|
72 |
|
|
73 |
// *************** FACTORY METHOD *********************************/ |
|
74 |
|
|
77 | 75 |
public static MediaRepresentationPart NewInstance(URI uri, Integer size) { |
78 | 76 |
MediaRepresentationPart result = new MediaRepresentationPart(uri, size); |
79 | 77 |
return result; |
80 | 78 |
} |
81 | 79 |
|
82 |
/** |
|
83 |
* |
|
84 |
*/ |
|
80 |
|
|
85 | 81 |
protected MediaRepresentationPart() { |
86 | 82 |
super(); |
87 | 83 |
} |
88 |
|
|
89 |
/** |
|
90 |
* |
|
91 |
*/ |
|
92 | 84 |
protected MediaRepresentationPart(URI uri, Integer size) { |
93 | 85 |
this(); |
94 | 86 |
this.setUri(uri); |
95 | 87 |
this.setSize(size); |
96 | 88 |
} |
97 | 89 |
|
98 |
/*************** getter /setter *************************************/
|
|
90 |
//*************** GETTER / SETTER *************************************/
|
|
99 | 91 |
|
100 | 92 |
public MediaRepresentation getMediaRepresentation() { |
101 | 93 |
return this.mediaRepresentation; |
... | ... | |
109 | 101 |
this.mediaRepresentation = mediaRepresentation; |
110 | 102 |
} |
111 | 103 |
|
104 |
//uri |
|
112 | 105 |
public URI getUri() { |
113 | 106 |
return this.uri; |
114 | 107 |
} |
115 |
|
|
116 |
/** |
|
117 |
* |
|
118 |
* @param uri |
|
119 |
* uri |
|
120 |
*/ |
|
121 | 108 |
public void setUri(URI uri) { |
122 | 109 |
this.uri = uri; |
123 | 110 |
} |
124 | 111 |
|
125 |
/** |
|
126 |
* @return |
|
127 |
*/ |
|
112 |
//size |
|
128 | 113 |
public Integer getSize() { |
129 | 114 |
return this.size; |
130 | 115 |
} |
131 |
|
|
132 |
/** |
|
133 |
* @param size |
|
134 |
* size |
|
135 |
*/ |
|
136 | 116 |
public void setSize(Integer size) { |
137 | 117 |
this.size = size; |
138 | 118 |
} |
139 | 119 |
|
140 | 120 |
//************************* CLONE **************************/ |
141 |
/* (non-Javadoc) |
|
142 |
* @see java.lang.Object#clone() |
|
143 |
*/ |
|
121 |
|
|
144 | 122 |
@Override |
145 | 123 |
public Object clone() throws CloneNotSupportedException{ |
146 | 124 |
MediaRepresentationPart result = (MediaRepresentationPart)super.clone(); |
cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/parser/NonViralNameParserImpl.java | ||
---|---|---|
54 | 54 |
* @author a.mueller |
55 | 55 |
* |
56 | 56 |
*/ |
57 |
public class NonViralNameParserImpl extends NonViralNameParserImplRegExBase implements INonViralNameParser<INonViralName> { |
|
57 |
public class NonViralNameParserImpl |
|
58 |
extends NonViralNameParserImplRegExBase |
|
59 |
implements INonViralNameParser<INonViralName> { |
|
58 | 60 |
private static final Logger logger = Logger.getLogger(NonViralNameParserImpl.class); |
59 | 61 |
|
60 | 62 |
// good intro: http://java.sun.com/docs/books/tutorial/essential/regex/index.html |
Also available in: Unified diff
cleanup