2 * Copyright (C) 2008 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 import java.util.regex.Pattern;
18 import java.util.regex.Matcher;
19 import org.clearsilver.HDF;
20 import org.clearsilver.CS;
21 import java.util.ArrayList;
23 public class SeeTagInfo extends TagInfo
25 private ContainerInfo mBase;
28 SeeTagInfo(String name, String kind, String text, ContainerInfo base,
29 SourcePositionInfo position)
31 super(name, kind, text, position);
35 protected LinkReference linkReference() {
37 mLink = LinkReference.parse(text(), mBase, position(),
38 (!"@see".equals(name())) && (mBase != null ? mBase.checkLevel() : true));
45 return linkReference().label;
48 public void makeHDF(HDF data, String base)
50 LinkReference linkRef = linkReference();
51 if (linkRef.kind != null) {
52 // if they have a better suggestion about "kind" use that.
53 // do this before super.makeHDF() so it picks it up
54 setKind(linkRef.kind);
57 super.makeHDF(data, base);
59 data.setValue(base + ".label", linkRef.label);
60 if (linkRef.href != null) {
61 data.setValue(base + ".href", linkRef.href);
65 public boolean checkLevel() {
66 return linkReference().checkLevel();
69 public static void makeHDF(HDF data, String base, SeeTagInfo[] tags)
72 for (SeeTagInfo tag: tags) {
73 if (tag.mBase.checkLevel() && tag.checkLevel()) {
74 tag.makeHDF(data, base + "." + j);