01: /*
02: * ====================================================================
03: * Copyright (c) 2004-2008 TMate Software Ltd. All rights reserved.
04: *
05: * This software is licensed as described in the file COPYING, which
06: * you should have received as part of this distribution. The terms
07: * are also available at http://svnkit.com/license.html
08: * If newer versions of this license are posted there, you may use a
09: * newer version instead, at your option.
10: * ====================================================================
11: */
12: package org.tmatesoft.svn.core.wc;
13:
14: import org.tmatesoft.svn.core.SVNProperty;
15:
16: /**
17: * <b>SVNPropertyData</b> is a wrapper for both versioned and unversioned
18: * properties. This class represents the pair: property name - property value.
19: * Property managing methods of the <b>SVNWCClient</b> class use
20: * <b>SVNPropertyData</b> to wrap properties and dispatch them to
21: * <b>handleProperty()</b> methods of <b>ISVNPropertyHandler</b> for processing
22: * or simply return that 'properties object' as a target.
23: *
24: * @version 1.1.1
25: * @author TMate Software Ltd.
26: * @see ISVNPropertyHandler
27: * @see SVNWCClient
28: */
29: public class SVNPropertyData {
30:
31: private String myValue;
32:
33: private String myName;
34:
35: /**
36: * Constructs an <b>SVNPropertyData</b> given a property name and its
37: * value.
38: *
39: * @param name a property name
40: * @param data a property value
41: */
42: public SVNPropertyData(String name, String data) {
43: myName = name;
44: myValue = data;
45: if (myValue != null && SVNProperty.isSVNProperty(myName)) {
46: myValue = myValue.replaceAll("\n", System
47: .getProperty("line.separator"));
48: }
49: }
50:
51: /**
52: * Gets the name of the property represented by this
53: * <b>SVNPropertyData</b> object.
54: *
55: * @return a property name
56: */
57: public String getName() {
58: return myName;
59: }
60:
61: /**
62: * Gets the value of the property represented by this
63: * <b>SVNPropertyData</b> object.
64: *
65: * @return a property value
66: */
67: public String getValue() {
68: return myValue;
69: }
70:
71: }
|