Gets the first child element with the given data type.
@param dataType the data type
@return the child element or null if not found
975260
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;
	}
372335
public <T> T dataToType(Class<T> type) {
        return Reflection.toType(data, type);
    }
386830
public XCalValue firstValue() {
		for (Element child : children()) {
			String childNamespace = child.getNamespaceURI();
			if (XCAL_NS.equals(childNamespace)) {
				ICalDataType dataType = toDataType(child.getLocalName());
				String value = child.getTextContent();
				return new XCalValue(dataType, value);
			}
		}

		return new XCalValue(null, element.getTextContent());
	}
28929
function getType(type_c, parent) {
  var type_js = type_c;
  _.find(xml2js.TYPEMAPS, function(to, from) {
    var pattern = new RegExp(from, 'i');
    if (type_c.search(pattern) == 0) {
      type_js = to;
      return true;
    }
  });
  if (isPointer(type_js)) {
    var dataType = getPointerDataType(type_js);
    var className = parent.toLowerCase();
    if (_.has(xml2js.ARRAY_TYPEMAPS, dataType) && _.contains(xml2js.ARRAY_TYPEMAPS[dataType].classes, className)) {
      type_js = xml2js.ARRAY_TYPEMAPS[dataType].arrayType;
    } else if (_.has(xml2js.POINTER_TYPEMAPS, className) && _.has(xml2js.POINTER_TYPEMAPS[className], dataType)) {
      type_js = xml2js.POINTER_TYPEMAPS[className][dataType];
    } else if (_.has(xml2js.CLASSES, dataType)) { // TODO: verify that swig does this mapping
      type_js = dataType;
    } else {
      type_js = dataType + ' &#42;'
    }
  }
  return type_js;
}
1162868
public Node firstChild() {

		if (currentNode == null)
			return null;

		Node node = getFirstChild(currentNode);

		if (node != null)
			currentNode = node;

		return node;
	}
652667
public Type getParentType()
    {
        Type ret = null;
        if (this.parentTypeId != null && this.parentTypeId != 0) {
            try {
                ret = Type.get(this.parentTypeId);
            } catch (final CacheReloadException e) {
                Type.LOG.error("Could not read parentType for id: {}", this.parentTypeId);
            }
        }
        return ret;
    }
792582
public double read(final DataType type) throws IOException {
        if (type == null) {
            throw new NullPointerException("type must not be null.");
        }
        switch (type) {
            case CHAR:
                ensureAvailable(1);
                return buffer.get();
            case UCHAR:
                ensureAvailable(1);
                return ( (int) buffer.get() ) & 0x000000FF;
            case SHORT:
                ensureAvailable(2);
                return buffer.getShort();
            case USHORT:
                ensureAvailable(2);
                return ( (int) buffer.getShort() ) & 0x0000FFFF;
            case INT:
                ensureAvailable(4);
                return buffer.getInt();
            case UINT:
                ensureAvailable(4);
                return ( (long) buffer.getShort() ) & 0x00000000FFFFFFFF;
            case FLOAT:
                ensureAvailable(4);
                return buffer.getFloat();
            case DOUBLE:
                ensureAvailable(8);
                return buffer.getDouble();
            default:
                throw new IllegalArgumentException("Unsupported type: " + type);
        }
    }
495696
private Element getChildElement(Element parent) {
	NodeList list = parent.getChildNodes();
	int len = list.getLength();
	for (int i = 0; i < len; i++) {
	    Node node = list.item(i);
	    if (node instanceof Element) {
		return (Element) node;
	    }
	}
	return null;
    }
135507
public static Datatype getDatatype(String datatypeKey) 
	{	
		Datatype dt = null;
		if(containsIdOrName(datatypeKey))
			dt = datatypesHash.get(datatypeKey.toUpperCase());
		else if(containsUri(datatypeKey)) 
			dt = datatypesHash.get(datatypeKey);
		else
			throw new IllegalArgumentException("Datatype not found : " + datatypeKey);
		
		if(!useObsoleteDatatypes 
				&& dt.isObsolete() != null 
				&& dt.isObsolete().booleanValue() == true)
			throw new IllegalArgumentException("Datatype " +
				datatypeKey + "(" + dt.getName() + ") is obsolete" +
					" (and useObsoleteDatatypes=false)");
		
		// return 
		return dt;
	}
852874
public ResourceDescription getChildDescription(String type, String name) {
        if (hasChildrenDefined()) {
            List<Property> children = get("children").asPropertyList();
            for (Property child : children) {
                if (type.equals(child.getName()) && child.getValue().hasDefined(MODEL_DESCRIPTION)) {
                    List<Property> modelDescriptions = child.getValue().get(MODEL_DESCRIPTION).asPropertyList();
                    for (Property modelDescription : modelDescriptions) {
                        if (name.equals(modelDescription.getName())) {
                            return new ResourceDescription(modelDescription.getValue());
                        }
                    }
                }
            }
        }
        return EMPTY;
    }
205505
function getNearestTypeElement(element) {
		var $element = $(element),
			found = $element.is('[data-type]');

		while (!found && $element.length && !$element.is(MODULE_SELECTOR)) {
			$element = $element.parent();
			found = $element.is('[data-type]');
		}

		return found ? $element[0] : null;
	}
804788
@Nullable
  public static Element findFirstElement(@Nonnull final Element node, @Nonnull final String elementName) {
    Element result = null;
    for (final Element l : Utils.findDirectChildrenForName(node, elementName)) {
      result = l;
      break;
    }
    return result;
  }
1012740
@Override
	public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
		return Collections.emptyList();
	}
370323
public List<ResourceHandle> getChildrenByType(final String type) {
        final ArrayList<ResourceHandle> children = new ArrayList<>();
        if (this.isValid()) {
            for (final Resource child : this.resource.getChildren()) {
                ResourceHandle handle = ResourceHandle.use(child);
                if (handle.isOfType(type)) {
                    children.add(handle);
                }
            }
        }
        return children;
    }
863761
@Override
    public Widget get(final int dataIndex) {
        return dataIndex >= size() ? null : getChildren().get(dataIndex);
    }
1250091
public XNElement childElement(String name) {
        for (XNElement e : children) {
            if (e.name.equals(name)) {
                return e;
            }
        }
        return null;
    }
412074
public static Optional<Class> getPrimitiveType(String primitiveType) {
        return Optional.ofNullable(PRIMITIVE_TYPE_MAP.get(primitiveType));
    }