dayOffRequest.setWeight(element.getAttribute("weight").getIntValue());
shiftOnRequest.setWeight(element.getAttribute("weight").getIntValue());
shiftOffRequest.setWeight(element.getAttribute("weight").getIntValue());
dayOnRequest.setWeight(element.getAttribute("weight").getIntValue());
int weight; if (enabled) { weight = element.getAttribute("weight").getIntValue(); if (weight < 0) { throw new IllegalArgumentException("The weight (" + weight
assertElementName(element, "Pattern"); String code = element.getAttribute("ID").getValue(); int weight = element.getAttribute("weight").getIntValue();
int minimumWeight; if (minimumEnabled) { minimumWeight = minElement.getAttribute("weight").getIntValue(); if (minimumWeight < 0) { throw new IllegalArgumentException("The minimumWeight (" + minimumWeight int maximumWeight; if (maximumEnabled) { maximumWeight = maxElement.getAttribute("weight").getIntValue(); if (maximumWeight < 0) { throw new IllegalArgumentException("The maximumWeight (" + maximumWeight
private Integer parseIntegerAttribute(Element sharingChild, String attrName) { Attribute integerAttribute = sharingChild.getAttribute(attrName); Integer integerAttr = null; if (integerAttribute != null) { try { integerAttr = new Integer(integerAttribute.getIntValue()); } catch (DataConversionException e) { // dont use the data } } return integerAttr; }
private Integer parseIntegerAttribute(Element sharingChild, String attrName) { Attribute integerAttribute = sharingChild.getAttribute(attrName); Integer integerAttr = null; if (integerAttribute != null) { try { integerAttr = new Integer(integerAttribute.getIntValue()); } catch (DataConversionException e) { // dont use the data } } return integerAttr; }
/** * This adds any labels it finds to our labels map. It also populates our * previous and next element hashes. */ private void addToNextPrevElement(List<Element> toProcess) throws DataConversionException { Element prev= null; for (int k= 0; k < toProcess.size(); k++) { Element cur= toProcess.get(k); if (cur.getName().equals("label")) { labels.put(cur.getAttribute("id").getIntValue(), cur); } if (prev != null) { nextElement.put(prev, cur); prevElement.put(cur, prev); } prev= cur; } }
static RegisterSet getDestReg(Element x, String name) throws DataConversionException { return RegisterSet.from(x.getAttribute(name).getIntValue()); }
/** * The list of registers this instruction writes with non objects */ public RegisterSet writesNonObj() throws DataConversionException { if (isWrite) { for (Attribute key : typeIsObj.keySet()) { for (String s : possibleWrites) { if (key.getName().equals(s)) { if (!typeIsObj.get(key)) { return RegisterSet.from(key.getIntValue()); } } } } } return RegisterSet.none(); }
/** * Extract the <slicelist depth="X" /> number from the <extensions> * element. */ public void consumeXML(Element element) { Element sliceList = element.getChild(SLICELIST, XScufl.XScuflNS); if (sliceList == null) { return; } Attribute depth = sliceList.getAttribute(DEPTH, XScufl.XScuflNS); if (depth == null) { return; } try { setDepth(depth.getIntValue()); } catch (DataConversionException ex) { logger.warn("Invalid depth: " + depth.getValue()); } }
/** * Returns the registers which this instruction writes objects into */ public RegisterSet writesObj() throws DataConversionException { if (isWrite) { for (Attribute key : typeIsObj.keySet()) { for (String s : possibleWrites) { if (key.getName().equals(s)) { if (typeIsObj.get(key)) { return RegisterSet.from(key.getIntValue()); } } } } } return RegisterSet.none(); }
/** * Extract the <flattenlist depth="X" /> number from the <extensions> * element. */ public void consumeXML(Element element) { Element flattenList = element.getChild(FLATTENLIST, XScufl.XScuflNS); if (flattenList == null) { return; } Attribute depth = flattenList.getAttribute(DEPTH, XScufl.XScuflNS); if (depth == null) { return; } try { setDepth(depth.getIntValue()); } catch (DataConversionException ex) { logger.warn("Invalid depth: " + depth.getValue()); } }
public JedisPoolConfig initRediPoolConfig() throws DataConversionException { Element element = JdomUtils.getRootElemet(FileUtil.getConfigURL(GlobalConstants.RedisConfigFile.REDIS_POOL_CONIFG).getFile()); JedisPoolConfig jedisPoolConfig = new JedisPoolConfig(); int maxIdle = element.getAttribute("maxIdle").getIntValue(); boolean testWhileIdle = element.getAttribute("testWhileIdle").getBooleanValue(); int timeBetweenEvictionRunsMillis = element.getAttribute("timeBetweenEvictionRunsMillis").getIntValue(); int numTestsPerEvictionRun = element.getAttribute("numTestsPerEvictionRun").getIntValue(); int minEvictableIdleTimeMillis = element.getAttribute("minEvictableIdleTimeMillis").getIntValue(); jedisPoolConfig.setTestWhileIdle(testWhileIdle); jedisPoolConfig.setMaxIdle(maxIdle); jedisPoolConfig.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis); jedisPoolConfig.setNumTestsPerEvictionRun(numTestsPerEvictionRun); jedisPoolConfig.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis); return jedisPoolConfig; }
public JedisPool initRedis(JedisPoolConfig jedisPoolConfig) throws DataConversionException { Element element = JdomUtils.getRootElemet(FileUtil.getConfigURL(GlobalConstants.RedisConfigFile.REDIS).getFile()); String host = element.getAttribute("host").getValue(); int port = element.getAttribute("port").getIntValue(); boolean hasPassword = element.getAttribute("password") != null; int database = element.getAttribute("database").getIntValue(); JedisPool jedisPool = new JedisPool(jedisPoolConfig, host, port); if (hasPassword) { int timeout = element.getAttribute("timeout").getIntValue(); String password = element.getAttribute("password").getValue(); jedisPool = new JedisPool(jedisPoolConfig, host, port, timeout, password, database); } return jedisPool; } }
/** * The entry point to this class. This function takes a method element and * processes it, adding instructions to release and retain objects as * needed. For the command set that it adds, see the InstructionProcessor * class. */ @SuppressWarnings("unchecked") public void process(Element method) throws DataConversionException, ReferenceCountingException { Attribute isAbstract= method.getAttribute("isAbstract"); Attribute isNative= method.getAttribute("isNative"); // abstract and native methods do not require processing if (isAbstract != null && isAbstract.getBooleanValue()) { return; } if (isNative != null && isNative.getBooleanValue()) { return; } Element codeElement= method.getChild("code", dex); int numReg= codeElement.getAttribute("register-size").getIntValue(); processRecStart(numReg, (List<Element>) codeElement.getChildren(), codeElement); }
public void testXMLExport() throws DataConversionException { Element e = getLocalWorker().provideXML(); assertEquals(XScufl.XScuflNS, e.getNamespace()); assertEquals("extensions", e.getName()); Element slicelist = e.getChild("slicelist", XScufl.XScuflNS); assertNotNull("Element <slicelist> not found", slicelist); Attribute depth = slicelist.getAttribute("depth", XScufl.XScuflNS); assertNotNull("Attribute depth='' not found", depth); assertEquals(1, depth.getIntValue()); }
public void testXMLExport() throws DataConversionException { Element e = getLocalWorker().provideXML(); assertEquals(XScufl.XScuflNS, e.getNamespace()); assertEquals("extensions", e.getName()); Element flattenlist = e.getChild("flattenlist", XScufl.XScuflNS); assertNotNull("Element <flattenlist> not found", flattenlist); Attribute depth = flattenlist.getAttribute("depth", XScufl.XScuflNS); assertNotNull("Attribute depth='' not found", depth); assertEquals(2, depth.getIntValue()); }