Exemple #1
0
 /**
  * Gets the first child element with the given data type.
  *
  * @param dataType the data type
  * @return the child element or null if not found
  */
 public XCalElement child(ICalDataType dataType) {
   String localName = dataType.getName().toLowerCase();
   for (Element child : children()) {
     if (localName.equals(child.getLocalName()) && XCAL_NS.equals(child.getNamespaceURI())) {
       return new XCalElement(child);
     }
   }
   return null;
 }
Exemple #2
0
 /**
  * Gets all child elements with the given data type.
  *
  * @param dataType the data type
  * @return the child elements
  */
 public List<XCalElement> children(ICalDataType dataType) {
   String localName = dataType.getName().toLowerCase();
   List<XCalElement> children = new ArrayList<XCalElement>();
   for (Element child : children()) {
     if (localName.equals(child.getLocalName()) && XCAL_NS.equals(child.getNamespaceURI())) {
       children.add(new XCalElement(child));
     }
   }
   return children;
 }
Exemple #3
0
 private String toLocalName(ICalDataType dataType) {
   return (dataType == null) ? "unknown" : dataType.getName().toLowerCase();
 }
Exemple #4
0
 /**
  * Adds an empty value.
  *
  * @param dataType the data type
  * @return the created element
  */
 public XCalElement append(ICalDataType dataType) {
   return append(dataType.getName().toLowerCase());
 }