1 /*
2  * JasperReports - Free Java Reporting Library.
3  * Copyright (C) 2001 - 2019 TIBCO Software Inc. All rights reserved.
4  * http://www.jaspersoft.com
5  *
6  * Unless you have purchased a commercial license agreement from Jaspersoft,
7  * the following license terms apply:
8  *
9  * This program is part of JasperReports.
10  *
11  * JasperReports is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License as published by
13  * the Free Software Foundation, either version 3 of the License, or
14  * (at your option) any later version.
15  *
16  * JasperReports is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * along with JasperReports. If not, see <http://www.gnu.org/licenses/>.
23  */

24 package net.sf.jasperreports.engine.type;
25
26 import net.sf.jasperreports.engine.JRHyperlink;
27
28
29 /**
30  * @author Teodor Danciu (teodord@users.sourceforge.net)
31  */

32 public enum HyperlinkTargetEnum implements JREnum
33 {
34     /**
35      * Target not defined.
36      */

37     NONE((byte)0, "None"null),
38
39     /**
40      * Constant useful for specifying that the hyperlink will be opened in the same window.
41      */

42     SELF((byte)1, "Self""_self"),
43
44     /**
45      * Constant useful for specifying that the hyperlink will be opened in a new window.
46      */

47     BLANK((byte)2, "Blank""_blank"),
48
49     /**
50      * Constant useful for specifying that the hyperlink will be opened in the parent frame.
51      */

52     PARENT((byte)3, "Parent""_parent"),
53
54     /**
55      * Constant useful for specifying that the hyperlink will be opened in the top frame.
56      */

57     TOP((byte)4, "Top""_top"),
58
59     /**
60      * Custom hyperlink target name.
61      * <p>
62      * The specific target name is determined by {@link JRHyperlink#getLinkTarget() getLinkTarget()}.
63      * </p>
64      */

65     CUSTOM((byte)5, "Custom"null);
66
67     /**
68      *
69      */

70     private final transient byte value;
71     private final transient String name;
72     private final transient String htmlValue;
73
74     private HyperlinkTargetEnum(byte value, String name, String htmlValue)
75     {
76         this.value = value;
77         this.name = name;
78         this.htmlValue = htmlValue;
79     }
80
81     /**
82      * @deprecated Used only by deprecated serialized fields.
83      */

84     @Override
85     public Byte getValueByte()
86     {
87         return value;
88     }
89     
90     /**
91      * @deprecated Used only by deprecated serialized fields.
92      */

93     @Override
94     public final byte getValue()
95     {
96         return value;
97     }
98     
99     @Override
100     public String getName()
101     {
102         return name;
103     }
104
105     /**
106      *
107      */

108     public String getHtmlValue()
109     {
110         return htmlValue;
111     }
112
113     /**
114      *
115      */

116     public static HyperlinkTargetEnum getByName(String name)
117     {
118         return EnumUtil.getEnumByName(values(), name);
119     }
120     
121     /**
122      * @deprecated Used only by deprecated serialized fields.
123      */

124     public static HyperlinkTargetEnum getByValue(Byte value)
125     {
126         return (HyperlinkTargetEnum)EnumUtil.getByValue(values(), value);
127     }
128     
129     /**
130      * @deprecated Used only by deprecated serialized fields.
131      */

132     public static HyperlinkTargetEnum getByValue(byte value)
133     {
134         return getByValue((Byte)value);
135     }
136 }
137