1 package org.apache.maven.shared.release.transform.jdom2;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.IOException;
23 import java.io.InputStream;
24 import java.io.OutputStream;
25 import java.io.PrintStream;
26 import java.io.PrintWriter;
27 import java.io.Reader;
28 import java.io.Writer;
29 import java.util.Enumeration;
30 import java.util.InvalidPropertiesFormatException;
31 import java.util.Properties;
32 import java.util.Set;
33
34 import org.jdom2.Element;
35
36
37
38
39
40
41
42 public class JDomProperties extends Properties
43 {
44 private final Element properties;
45
46
47
48
49
50
51 public JDomProperties( Element properties )
52 {
53 this.properties = properties;
54 }
55
56 @Override
57 public synchronized Object setProperty( String key, String value )
58 {
59 Element property = properties.getChild( key, properties.getNamespace() );
60
61 JDomUtils.rewriteValue( property, value );
62
63
64 return null;
65 }
66
67 @Override
68 public synchronized void load( Reader reader )
69 throws IOException
70 {
71 throw new UnsupportedOperationException();
72 }
73
74 @Override
75 public synchronized void load( InputStream inStream )
76 throws IOException
77 {
78 throw new UnsupportedOperationException();
79 }
80
81 @SuppressWarnings( "deprecation" )
82 @Override
83 public void save( OutputStream out, String comments )
84 {
85 throw new UnsupportedOperationException();
86 }
87
88 @Override
89 public void store( Writer writer, String comments )
90 throws IOException
91 {
92 throw new UnsupportedOperationException();
93 }
94
95 @Override
96 public void store( OutputStream out, String comments )
97 throws IOException
98 {
99 throw new UnsupportedOperationException();
100 }
101
102 @Override
103 public synchronized void loadFromXML( InputStream in )
104 throws IOException, InvalidPropertiesFormatException
105 {
106 throw new UnsupportedOperationException();
107 }
108
109 @Override
110 public void storeToXML( OutputStream os, String comment )
111 throws IOException
112 {
113 throw new UnsupportedOperationException();
114 }
115
116 @Override
117 public void storeToXML( OutputStream os, String comment, String encoding )
118 throws IOException
119 {
120 throw new UnsupportedOperationException();
121 }
122
123 @Override
124 public String getProperty( String key )
125 {
126 Element property = properties.getChild( key, properties.getNamespace() );
127
128 if ( property == null )
129 {
130 return null;
131 }
132 else
133 {
134 return property.getTextTrim();
135 }
136 }
137
138 @Override
139 public String getProperty( String key, String defaultValue )
140 {
141 throw new UnsupportedOperationException();
142 }
143
144 @Override
145 public Enumeration<?> propertyNames()
146 {
147 throw new UnsupportedOperationException();
148 }
149
150 @Override
151 public Set<String> stringPropertyNames()
152 {
153 throw new UnsupportedOperationException();
154 }
155
156 @Override
157 public void list( PrintStream out )
158 {
159 throw new UnsupportedOperationException();
160 }
161
162 @Override
163 public void list( PrintWriter out )
164 {
165 throw new UnsupportedOperationException();
166 }
167 }