public static int readIntChild ( Node node , String childNodeName , int defaultValue ) { if ( node == null ) { throw new XmlException ( "Tried to read int value from child of null node" ) ; } Node child = XmlUtils . getFirstChild ( node , childNodeName ) ; if ( child == null ) { return defaultValue ; } return XmlUtils . readInt ( child ) ; }
Read an int value from the first child of the given node with the given name . If no such child is found then the default value will be returned .