@Override public Object getValue(HttpContext c) { return i.getValue(); } };
for (Map.Entry<Method, Injectable<?>> e : singletons.entrySet()) { singletonSetters[i] = e.getKey(); singletonSetterValues[i++] = e.getValue().getValue();
for (Map.Entry<Field, Injectable<?>> e : singletons.entrySet()) { singletonFields[i] = e.getKey(); singletonFieldValues[i++] = e.getValue().getValue();
@Override public Object getValue(HttpContext c) { return i.getValue(); } };
@Override public Object getValue(HttpContext c) { return i.getValue(); } };
@Override protected final XMLStreamReader getXMLStreamReader(Class<?> elementType, MediaType mediaType, Unmarshaller u, InputStream entityStream) throws XMLStreamException { return xif.getValue().createXMLStreamReader(entityStream); }
@Override protected final XMLStreamReader getXMLStreamReader(Class<?> elementType, MediaType mediaType, Unmarshaller u, InputStream entityStream) throws XMLStreamException { return xif.getValue().createXMLStreamReader(entityStream); }
public Document readFrom( Class<Document> type, Type genericType, Annotation annotations[], MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { try { return dbf.getValue().newDocumentBuilder().parse(entityStream); } catch (SAXException ex) { throw new WebApplicationException(ex, Status.BAD_REQUEST); } catch (ParserConfigurationException ex) { throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR); } }
public Document readFrom( Class<Document> type, Type genericType, Annotation annotations[], MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { try { return dbf.getValue().newDocumentBuilder().parse(entityStream); } catch (SAXException ex) { throw new WebApplicationException(ex, Status.BAD_REQUEST); } catch (ParserConfigurationException ex) { throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR); } }
@Override protected Object readFrom(Class<Object> type, MediaType mediaType, Unmarshaller u, InputStream entityStream) throws JAXBException { final SAXSource s = getSAXSource(spf.getValue(), entityStream); if (type.isAnnotationPresent(XmlRootElement.class)) { return u.unmarshal(s); } else { return u.unmarshal(s, type).getValue(); } } }
protected final JAXBElement<?> readFrom(Class<?> type, MediaType mediaType, Unmarshaller u, InputStream entityStream) throws JAXBException { return u.unmarshal(getSAXSource(spf.getValue(), entityStream), type); }
protected final JAXBElement<?> readFrom(Class<?> type, MediaType mediaType, Unmarshaller u, InputStream entityStream) throws JAXBException { return u.unmarshal(getSAXSource(spf.getValue(), entityStream), type); }
@Override protected Object readFrom(Class<Object> type, MediaType mediaType, Unmarshaller u, InputStream entityStream) throws JAXBException { final SAXSource s = getSAXSource(spf.getValue(), entityStream); if (type.isAnnotationPresent(XmlRootElement.class)) { return u.unmarshal(s); } else { return u.unmarshal(s, type).getValue(); } } }
public DOMSource readFrom( Class<DOMSource> t, Type gt, Annotation[] as, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { try { Document d = dbf.getValue().newDocumentBuilder().parse(entityStream); return new DOMSource(d); } catch (SAXParseException ex) { throw new WebApplicationException(ex, Status.BAD_REQUEST); } catch (SAXException ex) { throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR); } catch (ParserConfigurationException ex) { throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR); } } }
public SAXSource readFrom( Class<SAXSource> t, Type gt, Annotation[] as, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { try { return new SAXSource(spf.getValue().newSAXParser().getXMLReader(), new InputSource(entityStream)); } catch (SAXParseException ex) { throw new WebApplicationException(ex, Status.BAD_REQUEST); } catch (SAXException ex) { throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR); } catch (ParserConfigurationException ex) { throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR); } } }
public void writeTo(Source o, Class<?> t, Type gt, Annotation[] as, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException { try { if (o instanceof StreamSource) { StreamSource s = (StreamSource)o; InputSource is = new InputSource(s.getInputStream()); o = new SAXSource(spf.getValue().newSAXParser().getXMLReader(), is); } StreamResult sr = new StreamResult(entityStream); tf.getValue().newTransformer().transform(o, sr); } catch (SAXException ex) { throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR); } catch (ParserConfigurationException ex) { throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR); } catch (TransformerException ex) { throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR); } } }
public SAXSource readFrom( Class<SAXSource> t, Type gt, Annotation[] as, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { try { return new SAXSource(spf.getValue().newSAXParser().getXMLReader(), new InputSource(entityStream)); } catch (SAXParseException ex) { throw new WebApplicationException(ex, Status.BAD_REQUEST); } catch (SAXException ex) { throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR); } catch (ParserConfigurationException ex) { throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR); } } }
public DOMSource readFrom( Class<DOMSource> t, Type gt, Annotation[] as, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { try { Document d = dbf.getValue().newDocumentBuilder().parse(entityStream); return new DOMSource(d); } catch (SAXParseException ex) { throw new WebApplicationException(ex, Status.BAD_REQUEST); } catch (SAXException ex) { throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR); } catch (ParserConfigurationException ex) { throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR); } } }
public void writeTo(Source o, Class<?> t, Type gt, Annotation[] as, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException { try { if (o instanceof StreamSource) { StreamSource s = (StreamSource)o; InputSource is = new InputSource(s.getInputStream()); o = new SAXSource(spf.getValue().newSAXParser().getXMLReader(), is); } StreamResult sr = new StreamResult(entityStream); tf.getValue().newTransformer().transform(o, sr); } catch (SAXException ex) { throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR); } catch (ParserConfigurationException ex) { throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR); } catch (TransformerException ex) { throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR); } } }
public Object readFrom( Class<Object> type, Type genericType, Annotation annotations[], MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { try { return getUnmarshaller(type, mediaType). unmarshal(getSAXSource(spf.getValue(), entityStream)); } catch (UnmarshalException ex) { throw new WebApplicationException(ex, Status.BAD_REQUEST); } catch (JAXBException ex) { throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR); } }