예제 #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;
 }
예제 #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;
 }
예제 #3
0
 private String toLocalName(ICalDataType dataType) {
   return (dataType == null) ? "unknown" : dataType.getName().toLowerCase();
 }
예제 #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());
 }