本文整理汇总了Java中org.jdom.Attribute.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java Attribute.getValue方法的具体用法?Java Attribute.getValue怎么用?Java Attribute.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jdom.Attribute
的用法示例。
在下文中一共展示了Attribute.getValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolveURI
import org.jdom.Attribute; //导入方法依赖的package包/类
/** Use xml:base attributes at feed and entry level to resolve relative links */
private String resolveURI(URL baseURI, Parent parent, String url) {
url = (url.equals(".") || url.equals("./")) ? "" : url;
if (isRelativeURI(url) && parent != null && parent instanceof Element) {
Attribute baseAtt = ((Element)parent).getAttribute("base", Namespace.XML_NAMESPACE);
String xmlBase = (baseAtt == null) ? "" : baseAtt.getValue();
if (!isRelativeURI(xmlBase) && !xmlBase.endsWith("/")) {
xmlBase = xmlBase.substring(0, xmlBase.lastIndexOf("/")+1);
}
return resolveURI(baseURI, parent.getParent(), xmlBase + url);
} else if (isRelativeURI(url) && parent == null) {
return baseURI + url;
} else if (baseURI != null && url.startsWith("/")) {
String hostURI = baseURI.getProtocol() + "://" + baseURI.getHost();
if (baseURI.getPort() != baseURI.getDefaultPort()) {
hostURI = hostURI + ":" + baseURI.getPort();
}
return hostURI + url;
}
return url;
}
示例2: getTaxonomy
import org.jdom.Attribute; //导入方法依赖的package包/类
/**
* Utility method to parse a taxonomy from an element.
* <p>
* @param desc the taxonomy description element.
* @return the string contained in the resource of the element.
*/
protected final String getTaxonomy(Element desc) {
String d = null;
Element taxo = desc.getChild("topic", getTaxonomyNamespace());
if (taxo!=null) {
Attribute a = taxo.getAttribute("resource", getRDFNamespace());
if (a!=null) {
d = a.getValue();
}
}
return d;
}
示例3: NamedTextAttr
import org.jdom.Attribute; //导入方法依赖的package包/类
public NamedTextAttr(@NotNull Element element) {
super(element);
final Attribute attribute = element.getAttribute(ATTR_NAME);
if (attribute != null) {
name = attribute.getValue();
}
if (name == null) {
name = "";
}
}
示例4: getDatasetAttributes
import org.jdom.Attribute; //导入方法依赖的package包/类
/**
* Get all of the attributes from the parent data set element.
* @param varXPath the variable whose parent data set will be used
* @return the attributes
* @throws JDOMException
*/
public HashMap <String, String> getDatasetAttributes(String varXPath) throws JDOMException {
HashMap<String, String> attrs = new HashMap<String, String>();
if (!varXPath.contains("@ID")) {
String[] parts = varXPath.split("/");
// Throw away index 0 since the string has a leading "/".
varXPath = "/"+parts[1]+"/"+parts[2]+"/dataset[@ID='"+parts[3]+"']/"+parts[4]+"/variable[@ID='"+parts[5]+"']";
}
Element variable = getElementByXPath(varXPath);
Element dataset = variable.getParentElement().getParentElement();
List attributes = dataset.getAttributes();
for (Iterator iter = attributes.iterator(); iter.hasNext();) {
Attribute attr = (Attribute) iter.next();
String name = attr.getName();
String value = attr.getValue();
if ( name != null && value != null && !name.equals("") && !value.equals("") ) {
attrs.put(name, value );
}
}
return attrs;
}
示例5: ModuleJdkOrderEntryImpl
import org.jdom.Attribute; //导入方法依赖的package包/类
ModuleJdkOrderEntryImpl(@NotNull Element element, @NotNull RootModelImpl rootModel, @NotNull ProjectRootManagerImpl projectRootManager) throws InvalidDataException {
super(rootModel, projectRootManager);
if (!element.getName().equals(OrderEntryFactory.ORDER_ENTRY_ELEMENT_NAME)) {
throw new InvalidDataException();
}
final Attribute jdkNameAttribute = element.getAttribute(JDK_NAME_ATTR);
if (jdkNameAttribute == null) {
throw new InvalidDataException();
}
final String jdkName = jdkNameAttribute.getValue();
final String jdkType = element.getAttributeValue(JDK_TYPE_ATTR);
final Sdk jdkByName = findJdk(jdkName, jdkType);
if (jdkByName == null) {
init(null, jdkName, jdkType);
}
else {
init(jdkByName, null, null);
}
}
示例6: loadState
import org.jdom.Attribute; //导入方法依赖的package包/类
@Override
public void loadState(Element state) {
final VirtualFileManager vfManager = VirtualFileManager.getInstance();
for (Object child : state.getChildren(FILE_ELEMENT)) {
if (child instanceof Element) {
final Element fileElement = (Element)child;
final Attribute filePathAttr = fileElement.getAttribute(PATH_ATTR);
if (filePathAttr != null) {
final String filePath = filePathAttr.getValue();
VirtualFile vf = vfManager.findFileByUrl(filePath);
if (vf != null) {
myFiles.add(vf);
}
}
}
}
}
示例7: loadImagesElement
import org.jdom.Attribute; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private static void loadImagesElement(Element root, HollowGesturePack pack) throws IOException
{ // folder
String localFilePath = "";
Attribute attribute = root.getAttribute(XmlNames.FOLDER);
if(attribute!=null)
localFilePath = attribute.getValue()+File.separator;
// images
List<Element> imgs = root.getChildren(XmlNames.IMAGE);
Iterator<Element> i = imgs.iterator();
while(i.hasNext())
{ Element tp = i.next();
loadImageElement(tp,localFilePath,pack);
}
}
示例8: loadImageElement
import org.jdom.Attribute; //导入方法依赖的package包/类
private static void loadImageElement(Element root, String individualFolder, HollowGesturePack pack) throws IOException
{ // folder
String localFilePath = individualFolder;
Attribute attribute = root.getAttribute(XmlNames.FOLDER);
if(attribute!=null)
localFilePath = localFilePath+attribute.getValue()+File.separator;
// file
String localPath = localFilePath + root.getAttribute(XmlNames.FILE).getValue().trim();
// name
String name = root.getAttribute(XmlNames.NAME).getValue().trim();
// result
pack.addCommonImageFileName(name,localPath);
}
示例9: loadShadowsElement
import org.jdom.Attribute; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private static void loadShadowsElement(Element root, HollowGesturePack pack) throws IOException
{ // folder
String localFilePath = "";
Attribute attribute = root.getAttribute(XmlNames.FOLDER);
if(attribute!=null)
localFilePath = attribute.getValue()+File.separator;
// shadows
List<Element> shdws = root.getChildren(XmlNames.SHADOW);
Iterator<Element> i = shdws.iterator();
while(i.hasNext())
{ Element tp = i.next();
loadShadowElement(tp,localFilePath,pack);
}
}
示例10: loadGesturesElement
import org.jdom.Attribute; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private static void loadGesturesElement(Element root, HollowGesturePack pack) throws IOException
{ // folder
String localFilePath = "";
Attribute attribute = root.getAttribute(XmlNames.FOLDER);
if(attribute!=null)
localFilePath = localFilePath+attribute.getValue()+File.separator;
// gestures
List<Element> gesturesList = root.getChildren();
Iterator<Element> i = gesturesList.iterator();
while(i.hasNext())
{ Element tp = i.next();
loadGestureElement(tp,pack,localFilePath);
}
}
示例11: loadBlockElement
import org.jdom.Attribute; //导入方法依赖的package包/类
private static void loadBlockElement(Element root, String individualFolder, String groupName, HollowTheme result, HashMap<String,HollowBlockFactory> abstractBlocks, Type type) throws IOException, ParserConfigurationException, SAXException, ClassNotFoundException
{ // name
String name = root.getAttribute(XmlNames.NAME).getValue();
//if(name.equalsIgnoreCase("common_soft"))
// System.out.println();
// folder
String localFilePath = individualFolder;
Attribute attribute = root.getAttribute(XmlNames.FOLDER);
localFilePath = localFilePath+File.separator+attribute.getValue();
// components
boolean isAbstract = type==Type.ABSTRACT;
HollowBlockFactory blockFactory = HollowBlockFactoryLoader.loadBlockFactory(localFilePath,abstractBlocks,isAbstract);
if(isAbstract)
abstractBlocks.put(name,blockFactory);
else
{ String fullname = groupName+Theme.GROUP_SEPARATOR+name;
result.addBlockFactory(fullname,blockFactory);
}
}
示例12: findAtomLink
import org.jdom.Attribute; //导入方法依赖的package包/类
/**
* Return URL string of Atom link element under parent element.
* Link with no rel attribute is considered to be rel="alternate"
* @param parent Consider only children of this parent element
* @param rel Consider only links with this relationship
*/
private String findAtomLink(Element parent, String rel) {
String ret = null;
List linksList = parent.getChildren("link", ATOM_10_NS);
if (linksList != null) {
for (Iterator links = linksList.iterator(); links.hasNext(); ) {
Element link = (Element)links.next();
Attribute relAtt = getAttribute(link, "rel");
Attribute hrefAtt = getAttribute(link, "href");
if ( (relAtt == null && "alternate".equals(rel))
|| (relAtt != null && relAtt.getValue().equals(rel))) {
ret = hrefAtt.getValue();
break;
}
}
}
return ret;
}
示例13: visit
import org.jdom.Attribute; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void visit(Element element) {
super.visit(element);
// Pick up event handlers
for (Attribute attribute : (List<Attribute>) element.getAttributes()) {
String name = attribute.getName();
String javaScriptSource = attribute.getValue();
if (DOMEventHelpers.isEventAttribute(name)) {
eventList.add(new EventHandlerJavaScriptSource(filename, javaScriptSource, getElementLineNumber(element), name));
}
}
// if (Options.isDSLEnabled()) {
// String tag = element.getName();
// Map<String, String> attributes = new HashMap<>();
// for (Attribute attribute : (List<Attribute>) element.getAttributes()) {
// attributes.put(attribute.getName(), attribute.getValue());
// }
// htmlElementList.add(new HtmlSource(tag, attributes, filename, getElementLineNumber(element)));
// }
}
示例14: processClass
import org.jdom.Attribute; //导入方法依赖的package包/类
private void processClass(CassandraMapping cassandraMapping, Element classElement) {
String tableName = classElement.getAttributeValue("table");
cassandraMapping.setCoreName(tableName);
List classAttributes = classElement.getAttributes();
for (Object anAttributeList : classAttributes) {
Attribute attribute = (Attribute) anAttributeList;
String attributeName = attribute.getName();
String attributeValue = attribute.getValue();
cassandraMapping.addProperty(attributeName, attributeValue);
}
List<Element> fields = classElement.getChildren("field");
for (Element field : fields) {
Field cassandraField = new Field();
List fieldAttributes = field.getAttributes();
processAttributes(fieldAttributes, cassandraField);
cassandraMapping.addCassandraField(cassandraField);
}
}
示例15: cacheChildDatasets
import org.jdom.Attribute; //导入方法依赖的package包/类
public static void cacheChildDatasets(Element catalog,
String path,
HashMap<String,Element> childDatasets){
Iterator i = catalog.getDescendants(datasetFilter);
Element thisDataset;
Attribute urlPath;
String urlPathValue;
while(i.hasNext()){
thisDataset = (Element)i.next();
urlPath = thisDataset.getAttribute("urlPath");
if(urlPath!=null){
urlPathValue = urlPath.getValue();
//System.out.println("Adding dataset with key: "+urlPathValue);
childDatasets.put(urlPathValue,thisDataset);
}
}
}