KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > directory > ldapstudio > browser > core > model > ldif > lines > LdifVersionLine


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  *
19  */

20
21 package org.apache.directory.ldapstudio.browser.core.model.ldif.lines;
22
23
24 import org.apache.directory.ldapstudio.browser.core.BrowserCoreConstants;
25
26
27 public class LdifVersionLine extends LdifValueLineBase
28 {
29
30     private static final long serialVersionUID = 7302151354496025254L;
31
32
33     protected LdifVersionLine()
34     {
35     }
36
37
38     public LdifVersionLine( int offset, String JavaDoc rawVersionSpec, String JavaDoc rawValueType, String JavaDoc rawVersion, String JavaDoc rawNewLine )
39     {
40         super( offset, rawVersionSpec, rawValueType, rawVersion, rawNewLine );
41     }
42
43
44     public String JavaDoc getRawVersionSpec()
45     {
46         return super.getRawLineStart();
47     }
48
49
50     public String JavaDoc getUnfoldedVersionSpec()
51     {
52         return super.getUnfoldedLineStart();
53     }
54
55
56     public String JavaDoc getRawVersion()
57     {
58         return super.getRawValue();
59     }
60
61
62     public String JavaDoc getUnfoldedVersion()
63     {
64         return super.getUnfoldedValue();
65     }
66
67
68     public String JavaDoc toRawString()
69     {
70         return super.toRawString();
71     }
72
73
74     public boolean isValid()
75     {
76         return super.isValid();
77     }
78
79
80     public String JavaDoc getInvalidString()
81     {
82         if ( this.getUnfoldedVersionSpec().length() == 0 )
83         {
84             return "Missing version spec";
85         }
86         else if ( this.getUnfoldedVersion().length() == 0 )
87         {
88             return "Missing version";
89         }
90         else
91         {
92             return super.getInvalidString();
93         }
94     }
95
96
97     public static LdifVersionLine create()
98     {
99         return new LdifVersionLine( 0, "version", ":", "1", BrowserCoreConstants.LINE_SEPARATOR );
100     }
101
102 }
103
Popular Tags