blob: 3ccf0102a7993a597a680503842a9b3eb3e3c3ce [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.felix.scrplugin.tags.qdox;
import java.util.Map;
import org.apache.felix.scrplugin.tags.*;
import com.thoughtworks.qdox.model.DocletTag;
/**
* <code>QDoxJavaTag.java</code>...
*
*/
public class QDoxJavaTag implements JavaTag {
protected final DocletTag docletTag;
protected final JavaClassDescription description;
protected final JavaField field;
public QDoxJavaTag(DocletTag t, JavaClassDescription desc) {
this(t, desc, null);
}
public QDoxJavaTag(DocletTag t, JavaClassDescription desc, JavaField field) {
this.docletTag = t;
this.description = desc;
this.field = field;
}
/**
* @see org.apache.felix.scrplugin.tags.JavaTag#getName()
*/
public String getName() {
return this.docletTag.getName();
}
/**
* @see org.apache.felix.scrplugin.tags.JavaTag#getSourceName()
*/
public String getSourceName() {
return this.getName();
}
/**
* @see org.apache.felix.scrplugin.tags.JavaTag#getNamedParameter(java.lang.String)
*/
public String getNamedParameter(String arg0) {
return this.docletTag.getNamedParameter(arg0);
}
/**
* @see org.apache.felix.scrplugin.tags.JavaTag#getParameters()
*/
public String[] getParameters() {
return this.docletTag.getParameters();
}
/**
* @see org.apache.felix.scrplugin.tags.JavaTag#getSourceLocation()
*/
public String getSourceLocation() {
if ( this.docletTag.getContext().getParent() != null ) {
return String.valueOf(this.docletTag.getContext().getParent().getParentSource().getURL());
}
return String.valueOf(this.docletTag.getContext().getParentClass().getSource().getURL());
}
/**
* @see org.apache.felix.scrplugin.tags.JavaTag#getLineNumber()
*/
public int getLineNumber() {
return this.docletTag.getLineNumber();
}
/**
* @see org.apache.felix.scrplugin.tags.JavaTag#getJavaClassDescription()
*/
public JavaClassDescription getJavaClassDescription() {
return this.description;
}
/**
* @see org.apache.felix.scrplugin.tags.JavaTag#getNamedParameterMap()
*/
@SuppressWarnings("unchecked")
public Map<String, String> getNamedParameterMap() {
return this.docletTag.getNamedParameterMap();
}
/**
* @see org.apache.felix.scrplugin.tags.JavaTag#getField()
*/
public JavaField getField() {
return this.field;
}
}