if (getLogger().isLoggable(Level.WARNING)) getLogger().warning("line " + in.getLineNumber() + ": " + e.toString()); if (getLogger().isLoggable(Level.FINE)) getLogger().log(Level.FINE, "line " + in.getLineNumber() + ": " + e.getMessage(), e);
public String toString() { return "["+getClass().getName()+"] "+mOrig.toString(); } }
public String toString() { return "["+getClass().getName()+"] "+mOrig.toString(); } }
public String toString() { return "["+getClass().getName()+"] "+mOrig.toString(); } }
public String toString() { return "["+getClass().getName()+"] "+mOrig.toString(); } }
public String toString() { return "["+getClass().getName()+"] "+mOrig.toString(); } }
@Override public String toString() { return "["+getClass().getName()+"] "+mOrig.toString(); } }
@Override public String toString() { return "["+getClass().getName()+"] "+mOrig.toString(); } }
@Override public String toString() { return "["+getClass().getName()+"] "+mOrig.toString(); } }
/** * Writes the closing {@code </stream>} tag to make this XML well formed. * */ public void close() { try { this.outputStreamWriter.writeEndElement(); } catch (XMLStreamException e) { log(ERROR, e.toString()); } }
public String toString() { StringWriter sw = new StringWriter(64); try { writeAsEncodedUnicode(sw); } catch (XMLStreamException e) { sw.write("[ERROR: "); sw.write(e.toString()); sw.write("]"); } return sw.toString(); } }
/** * Closes the reader. * * @return true if success, false otherwise */ public BooleanValue close() { if (! streamIsOpen()) return BooleanValue.TRUE; try { _streamReader.close(); } catch (XMLStreamException ex) { log.log(Level.WARNING, ex.toString(), ex); return BooleanValue.FALSE; } return BooleanValue.TRUE; }
/** * Utility to return the content of this class into the CIM XML format * * @param xmlsw * the stream in which are stored the elements to write */ private void writeClass(XMLStreamWriter xmlsw) { if (currentBitset.get(0)) { for (CurveData curveScheduleDatas : this.curveScheduleDatas){ try { xmlsw.writeEmptyElement(CIMURI.CIMURI,"Curve.CurveScheduleDatas"); xmlsw.writeAttribute(CIMModel.rdfURI, "resource", "#" + curveScheduleDatas.getId()); } catch (XMLStreamException e) { StringBuilder errorMessage = new StringBuilder( "Error while trying to write the reference to "); errorMessage.append("Curve "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); errorMessage.append(" in the subset "); errorMessage.append("${subsetModel.getSubset($class).getName()}"); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); } } } return; }
/** * Utility to return the content of this class into the CIM XML format * * @param xmlsw * the stream in which are stored the elements to write */ private void writeClass(XMLStreamWriter xmlsw) { if (currentBitset.get(0)) { try { // xmlsw.writeCharacters("\t"); xmlsw.writeStartElement(CIMURI.CIMURI, "CurrentLimit.value"); xmlsw.writeCharacters(String.valueOf(getValue())); xmlsw.writeEndElement(); // xmlsw.writeCharacters("\n"); } catch(XMLStreamException e) { StringBuilder errorMessage = new StringBuilder( "Error while trying to write the value of the attribute "); errorMessage.append("Value"); errorMessage.append(" in class "); errorMessage.append("CurrentLimit "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); } } return; }
/** * Utility to return the content of this class into the CIM XML format * * @param xmlsw * the stream in which are stored the elements to write */ private void writeClass(XMLStreamWriter xmlsw) { if (currentBitset.get(0)) { for (TransformerWinding contains_TransformerWindings : this.contains_TransformerWindings){ try { xmlsw.writeEmptyElement(CIMURI.CIMURI,"PowerTransformer.Contains_TransformerWindings"); xmlsw.writeAttribute(CIMModel.rdfURI, "resource", "#" + contains_TransformerWindings.getId()); } catch (XMLStreamException e) { StringBuilder errorMessage = new StringBuilder( "Error while trying to write the reference to "); errorMessage.append("PowerTransformer "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); errorMessage.append(" in the subset "); errorMessage.append("Equipment"); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); } } } return; }
/** * Utility to return the content of this class into the CIM XML format * * @param xmlsw * the stream in which are stored the elements to write */ private void writeClass(XMLStreamWriter xmlsw) { if (currentBitset.get(0)) { for (TopologicalNode topologicalNode : this.topologicalNode){ try { xmlsw.writeEmptyElement(CIMURI.CIMURI,"ConnectivityNodeContainer.TopologicalNode"); xmlsw.writeAttribute(CIMModel.rdfURI, "resource", "#" + topologicalNode.getId()); } catch (XMLStreamException e) { StringBuilder errorMessage = new StringBuilder( "Error while trying to write the reference to "); errorMessage.append("ConnectivityNodeContainer "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); errorMessage.append(" in the subset "); errorMessage.append("${subsetModel.getSubset($class).getName()}"); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); } } } return; }
/** * Opens a stream using the uniform resource locator. * * @param uri uniform resource locator to open * @return true if success, false otherwise */ public BooleanValue open(Env env, Path path) { try { XMLInputFactory factory = XMLInputFactory.newInstance(); _streamReader = factory.createXMLStreamReader( path.getNativePath(), path.openRead()); } catch (XMLStreamException ex) { log.log(Level.WARNING, ex.toString(), ex); env.warning(L.l("XML input file '{0}' cannot be opened for reading.", path)); return BooleanValue.FALSE; } catch (IOException ex) { log.log(Level.WARNING, ex.toString(), ex); env.warning(L.l("Unable to open source data")); return BooleanValue.FALSE; } return BooleanValue.TRUE; }
private String scanEjbJarXml(Path ejbJarXml) { // XXX use Config.configure once com.caucho.ejb.cfg allows configuration // without a live EjbManager try { XMLStreamReaderImpl reader = new XMLStreamReaderImpl(ejbJarXml.openRead()); while (reader.hasNext()) { if (reader.next() == XMLStreamReader.START_ELEMENT && "module-name".equals(reader.getLocalName())) return reader.getElementText(); } } catch (IOException e) { log.log(Level.FINE, e.toString(), e); } catch (XMLStreamException e) { log.log(Level.FINE, e.toString(), e); } return null; }
/** * Writes an {@code Event} object to Splunk. This method is not thread safe. If you need a thread safe version, use * {@code synchronizedWriteEvent}. * * If you try to write an {@code Event} with null data, throws {@code MalformedDataException}. * * @see #synchronizedWriteEvent * @param event The {@code Event} object to write. * @throws MalformedDataException */ public void writeEvent(Event event) throws MalformedDataException { try { if (!headerWritten) { outputStreamWriter.writeStartElement("stream"); headerWritten = true; } event.writeTo(outputStreamWriter); outputStreamWriter.flush(); } catch (MalformedDataException e) { log(WARN, e.toString()); throw e; } catch (XMLStreamException e) { log(ERROR, e.toString()); } }
/** * {@inheritDoc} */ public Subscription getSubscription(String id) throws EventException { Subscription sub = null; try { resTopicIndex = registry.get(getTopicIndexPath()); String topic = resTopicIndex.getProperty(id); String subStorePath = getSubscriptionStoragePath(); if (subStorePath != null) { subStorePath = subStorePath + topic; } else { subStorePath = topic; } Resource resource = registry.get(subStorePath + "/" + id); if (resource != null) { if (EPR_TYPE.equals(resource.getMediaType())) { sub = regStorageToSubscription(resource); sub.setId(id); } } } catch (RegistryException e) { log.error("Error reading subscription" + e.toString()); } catch (XMLStreamException e) { log.error("Error processing subscription" + e.toString()); } return sub; }