Here you can find the source of getDoubleArrayTagAttribute(XMLStreamReader xmler, String attribute, double[] defaultValue)
public static double[] getDoubleArrayTagAttribute(XMLStreamReader xmler, String attribute, double[] defaultValue)
//package com.java2s; /******************************************************************************* * Copyright (c) 2016 Weasis Team and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors://from w ww . ja v a2s . c o m * Nicolas Roduit - initial API and implementation *******************************************************************************/ import javax.xml.stream.XMLStreamReader; public class Main { public static double[] getDoubleArrayTagAttribute(XMLStreamReader xmler, String attribute, double[] defaultValue) { return getDoubleArrayTagAttribute(xmler, attribute, defaultValue, "\\"); //$NON-NLS-1$ } public static double[] getDoubleArrayTagAttribute(XMLStreamReader xmler, String attribute, double[] defaultValue, String separator) { if (attribute != null) { String val = xmler.getAttributeValue(null, attribute); if (val != null) { String[] strs = val.split(separator); double[] vals = new double[strs.length]; for (int i = 0; i < strs.length; i++) { vals[i] = Double.parseDouble(strs[0]); } return vals; } } return defaultValue; } }