📄 resourcedescriptor.java
字号:
package com.opensymphony.tonic.elements;
import org.dom4j.Element;
import java.util.Map;
import com.opensymphony.tonic.loaders.LoaderUtils;
public class ResourceDescriptor
{
String type;
String name;
String location;
private String content;
private Map params;
public ResourceDescriptor(Element element)
{
this.type = element.attributeValue("type");
this.name = element.attributeValue("name");
this.location = element.attributeValue("location");
this.params = LoaderUtils.getParams(element);
if (element.getTextTrim() != null && !"".equals(element.getTextTrim()))
{
content = element.getTextTrim();
}
}
public String getType()
{
return type;
}
public String getName()
{
return name;
}
public String getLocation()
{
return location;
}
public String getContent()
{
return content;
}
public String getParameter(String key)
{
return (String) params.get(key);
}
public boolean equals(Object o)
{
if (this == o) return true;
if (!(o instanceof ResourceDescriptor)) return false;
final ResourceDescriptor resourceDescriptor = (ResourceDescriptor) o;
if (!name.equals(resourceDescriptor.name)) return false;
if (!type.equals(resourceDescriptor.type)) return false;
return true;
}
public int hashCode()
{
int result;
result = type.hashCode();
result = 29 * result + name.hashCode();
return result;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -