private Element getChildByName(Element element, String ns, String localName) { NodeList nl = element.getElementsByTagNameNS(ns, localName); if (nl.getLength() == 1) { return (Element) nl.item(0); } else { throw new MarkLogicBindingException( "Invalid rule - must have one element only named " + localName); } }
private Element getChildByName(Element element, String ns, String localName) { NodeList nl = element.getElementsByTagNameNS(ns, localName); if (nl.getLength() == 1) { return (Element) nl.item(0); } else { throw new MarkLogicBindingException( "Invalid rule - must have one element only named " + localName); } }
public TuplesHandle() { super(); super.setFormat(Format.XML); try { jc = JAXBContext.newInstance(TuplesBuilder.Tuples.class); unmarshaller = jc.createUnmarshaller(); } catch (JAXBException e) { throw new MarkLogicBindingException(e); } }
/** * Zero-argument constructor. */ public ValuesHandle() { super(); super.setFormat(Format.XML); try { jc = JAXBContext.newInstance(ValuesBuilder.Values.class); unmarshaller = jc.createUnmarshaller(); } catch (JAXBException e) { throw new MarkLogicBindingException(e); } }
/** * The constructor. */ public ValuesListHandle() { super(); super.setFormat(Format.XML); try { jc = JAXBContext.newInstance(ValuesListBuilder.ValuesList.class); unmarshaller = jc.createUnmarshaller(); } catch (JAXBException e) { throw new MarkLogicBindingException(e); } }
/** * The constructor. */ public QueryOptionsListHandle() { super(); super.setFormat(Format.XML); try { jc = JAXBContext.newInstance(QueryOptionsListBuilder.OptionsList.class); marshaller = jc.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); unmarshaller = jc.createUnmarshaller(); } catch (JAXBException e) { throw new MarkLogicBindingException(e); } }
private void checkForEmptyBeans(Throwable e) { Throwable cause = e.getCause(); if ( cause != null ) { if ( cause instanceof JsonMappingException && cause.getMessage() != null && cause.getMessage().contains("SerializationFeature.FAIL_ON_EMPTY_BEANS") ) { throw new MarkLogicBindingException( "Each of your pojo beans and descendent beans must have public fields or paired get/set methods", cause); } else { checkForEmptyBeans(cause); } } }
public TuplesHandle() { super(); super.setFormat(Format.XML); try { JAXBContext jc = JaxbContextLoader.CACHED_CONTEXT; unmarshaller = jc.createUnmarshaller(); } catch (JAXBException e) { throw new MarkLogicBindingException(e); } catch (NoClassDefFoundError ncdfe) { throw new MarkLogicBindingException(new JAXBException("JAXB context initialization failed")); } }
optionsHolder = (QueryOptions) unmarshaller.unmarshal(in); } catch (JAXBException e) { throw new MarkLogicBindingException(e); } catch (ParserConfigurationException e) { throw new MarkLogicBindingException(e); } catch (TransformerConfigurationException e) { throw new MarkLogicBindingException(e); } catch (TransformerException e) { throw new MarkLogicBindingException(e); } catch (SAXException e) { throw new MarkLogicBindingException(e); } catch (UnsupportedEncodingException e) { throw new MarkLogicBindingException(e);
/** * Zero-argument constructor. */ public ValuesHandle() { super(); super.setFormat(Format.XML); try { JAXBContext jc = JaxbContextLoader.CACHED_CONTEXT; unmarshaller = jc.createUnmarshaller(); } catch (JAXBException e) { throw new MarkLogicBindingException(e); } catch (NoClassDefFoundError ncdfe) { throw new MarkLogicBindingException(new JAXBException("JAXB context initialization failed")); } }
/** * The constructor. */ public QueryOptionsListHandle() { super(); super.setFormat(Format.XML); try { JAXBContext jc = JaxbContextLoader.CACHED_CONTEXT; marshaller = jc.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); unmarshaller = jc.createUnmarshaller(); } catch (JAXBException e) { throw new MarkLogicBindingException(e); } catch (NoClassDefFoundError ncdfe) { throw new MarkLogicBindingException(new JAXBException("JAXB context initialization failed")); } }
/** * The constructor. */ public ValuesListHandle() { super(); super.setFormat(Format.XML); try { JAXBContext jc = JaxbContextLoader.CACHED_CONTEXT; unmarshaller = jc.createUnmarshaller(); } catch (JAXBException e) { throw new MarkLogicBindingException(e); } catch (NoClassDefFoundError ncdfe) { throw new MarkLogicBindingException(new JAXBException("JAXB context initialization failed")); } }
logger.debug("End write of QueryOptionsHandle"); } catch (JAXBException e) { throw new MarkLogicBindingException(e); } catch (ParserConfigurationException e) { throw new MarkLogicBindingException(e); } catch (TransformerConfigurationException e) { throw new MarkLogicBindingException(e); } catch (TransformerException e) { throw new MarkLogicBindingException(e); } catch (SAXException e) { throw new MarkLogicBindingException(e);
throw new IllegalArgumentException("cannot construct "+columnName+" value as class: "+as.getName()); } catch (InstantiationException e) { throw new MarkLogicBindingException("could not construct value as class: "+as.getName(), e); } catch (IllegalAccessException e) { throw new MarkLogicBindingException("could not construct value as class: "+as.getName(), e); } catch (IllegalArgumentException e) { throw new MarkLogicBindingException("could not construct value as class: "+as.getName(), e); } catch (InvocationTargetException e) { throw new MarkLogicBindingException("could not construct value as class: "+as.getName(), e);
/** * Construct a new empty QueryOptionsHandle object. */ public QueryOptionsHandle() { super.setFormat(Format.XML); setResendable(true); optionsHolder = new QueryOptions(); try { SAXParser parser = pfactory.newSAXParser(); XMLReader reader = parser.getXMLReader(); QueryOptionsTransformExtractNS transform = new QueryOptionsTransformExtractNS(); transform.setParent(reader); jc = JAXBContext.newInstance(QueryOptions.class); marshaller = jc.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); unmarshaller = jc.createUnmarshaller(); } catch (JAXBException e) { throw new MarkLogicBindingException(e); } catch (SAXException e) { throw new MarkLogicBindingException(e); } catch (ParserConfigurationException e) { throw new MarkLogicBindingException(e); } }