587
|
1 |
/*
|
|
2 |
* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
package com.nokia.helium.ant.data;
|
|
19 |
|
|
20 |
import org.dom4j.Comment;
|
|
21 |
|
|
22 |
/**
|
|
23 |
* Meta object for a property that is defined entirely by a comment.
|
|
24 |
*/
|
|
25 |
public class PropertyCommentMeta extends CommentMeta {
|
|
26 |
|
|
27 |
/**
|
|
28 |
* Constructor.
|
|
29 |
*
|
|
30 |
* @param parent The parent meta object.
|
|
31 |
* @param propertyNode XML node representing the comment.
|
|
32 |
*/
|
628
|
33 |
public PropertyCommentMeta(AntObjectMeta parent, Comment comment) {
|
587
|
34 |
super(parent, comment);
|
|
35 |
}
|
|
36 |
|
|
37 |
/**
|
|
38 |
* Returns the property name as it is defined at the top of the comment
|
|
39 |
* block for that property.
|
|
40 |
*/
|
|
41 |
public String getName() {
|
|
42 |
return getComment().getObjectName();
|
|
43 |
}
|
|
44 |
|
|
45 |
/**
|
|
46 |
* There is no default value for properties defined only by comments.
|
|
47 |
*/
|
|
48 |
public String getDefaultValue() {
|
|
49 |
return "";
|
|
50 |
}
|
|
51 |
|
|
52 |
public String getType() {
|
|
53 |
return getComment().getTagValue("type", PropertyMeta.DEFAULT_TYPE);
|
|
54 |
}
|
|
55 |
|
|
56 |
public String getEditable() {
|
|
57 |
return getComment().getTagValue("editable", PropertyMeta.DEFAULT_EDITABLE);
|
|
58 |
}
|
|
59 |
}
|