/** * Get the JAXB Unmarshaller * @param pkgName The package name for the jaxb context * @return unmarshaller * @throws JAXBException */ public static Unmarshaller getUnmarshaller(String pkgName) throws JAXBException { if (pkgName == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "pkgName"); JAXBContext jc = getJAXBContext(pkgName); return jc.createUnmarshaller(); }
/** * Get the JAXB Unmarshaller * @param pkgName The package name for the jaxb context * @return unmarshaller * @throws JAXBException */ public static Unmarshaller getUnmarshaller(String pkgName) throws JAXBException { if (pkgName == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "pkgName"); JAXBContext jc = getJAXBContext(pkgName); return jc.createUnmarshaller(); }
public static JAXBContext getJAXBContext(String... paths) throws JAXBException { int len = paths.length; if (len == 0) return getJAXBContext(paths[0]); StringBuilder builder = new StringBuilder(); for (String path : paths) { builder.append(path).append(":"); } String finalPath = builder.toString(); JAXBContext jx = jaxbContextHash.get(finalPath); if (jx == null) { jx = JAXBContext.newInstance(finalPath); jaxbContextHash.put(finalPath, jx); } return jx; }
/** * Get the JAXB Marshaller * @param pkgName The package name for the jaxb context * @return Marshaller * @throws JAXBException */ public static Marshaller getMarshaller(String pkgName) throws JAXBException { if (pkgName == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "pkgName"); JAXBContext jc = getJAXBContext(pkgName); Marshaller marshaller = jc.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8"); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.FALSE); //Breaks signatures return marshaller; }
/** * Get the JAXB Marshaller * @param pkgName The package name for the jaxb context * @return Marshaller * @throws JAXBException */ public static Marshaller getMarshaller(String pkgName) throws JAXBException { if (pkgName == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "pkgName"); JAXBContext jc = getJAXBContext(pkgName); Marshaller marshaller = jc.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8"); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.FALSE); //Breaks signatures return marshaller; }
public static JAXBContext getJAXBContext(String... paths) throws JAXBException { int len = paths.length; if (len == 0) return getJAXBContext(paths[0]); StringBuilder builder = new StringBuilder(); for (String path : paths) { builder.append(path).append(":"); } String finalPath = builder.toString(); JAXBContext jx = jaxbContextHash.get(finalPath); if (jx == null) { jx = JAXBContext.newInstance(finalPath); jaxbContextHash.put(finalPath, jx); } return jx; }
public static JAXBContext getJAXBContext(String... paths) throws JAXBException { int len = paths.length; if (len == 0) return getJAXBContext(paths[0]); StringBuilder builder = new StringBuilder(); for (String path : paths) { builder.append(path).append(":"); } String finalPath = builder.toString(); JAXBContext jx = jaxbContextHash.get(finalPath); if (jx == null) { jx = JAXBContext.newInstance(finalPath); jaxbContextHash.put(finalPath, jx); } return jx; }
public static JAXBContext getJAXBContext(String... paths) throws JAXBException { int len = paths.length; if (len == 0) return getJAXBContext(paths[0]); StringBuilder builder = new StringBuilder(); for (String path : paths) { builder.append(path).append(":"); } String finalPath = builder.toString(); JAXBContext jx = jaxbContextHash.get(finalPath); if (jx == null) { jx = JAXBContext.newInstance(finalPath); jaxbContextHash.put(finalPath, jx); } return jx; }
/** * Get the JAXB Unmarshaller * * @param pkgName The package name for the jaxb context * @return unmarshaller * @throws JAXBException */ public static Unmarshaller getUnmarshaller(String pkgName) throws JAXBException { if (pkgName == null) throw logger.nullArgumentError("pkgName"); JAXBContext jc = getJAXBContext(pkgName); return jc.createUnmarshaller(); }
/** * Get the JAXB Unmarshaller * * @param pkgName The package name for the jaxb context * * @return unmarshaller * * @throws JAXBException */ public static Unmarshaller getUnmarshaller(String pkgName) throws JAXBException { if (pkgName == null) throw logger.nullArgumentError("pkgName"); JAXBContext jc = getJAXBContext(pkgName); return jc.createUnmarshaller(); }
private StatusResponseType getSamlResponse(Document document) throws InvalidRequestException { try { JAXBContext jaxb = JAXBUtil.getJAXBContext(StatusResponseType.class); Unmarshaller unmarshaller = jaxb.createUnmarshaller(); @SuppressWarnings("unchecked") JAXBElement<StatusResponseType> jaxbResponseType = (JAXBElement<StatusResponseType>) unmarshaller .unmarshal(document); StatusResponseType statusResponse = jaxbResponseType.getValue(); return statusResponse; } catch (JAXBException e) { throw new InvalidRequestException("SAML message could not be parsed", e); } }
/** * Get the JAXB Marshaller * * @param pkgName The package name for the jaxb context * @return Marshaller * @throws JAXBException */ public static Marshaller getMarshaller(String pkgName) throws JAXBException { if (pkgName == null) throw logger.nullArgumentError("pkgName"); JAXBContext jc = getJAXBContext(pkgName); Marshaller marshaller = jc.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8"); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.FALSE); // Breaks signatures return marshaller; }
private RequestAbstractType getSamlRequest(Document document) throws InvalidRequestException { try { JAXBContext jaxb = JAXBUtil.getJAXBContext(StatusResponseType.class); Unmarshaller unmarshaller = jaxb.createUnmarshaller(); @SuppressWarnings("unchecked") JAXBElement<RequestAbstractType> jaxbRequest = (JAXBElement<RequestAbstractType>) unmarshaller .unmarshal(document); RequestAbstractType request = jaxbRequest.getValue(); return request; } catch (JAXBException e) { throw new InvalidRequestException("SAML message could not be parsed", e); } }
/** * Get the JAXB Unmarshaller * * @param pkgName The package name for the jaxb context * * @return unmarshaller * * @throws JAXBException */ public static Unmarshaller getUnmarshaller(String pkgName) throws JAXBException { if (pkgName == null) throw logger.nullArgumentError("pkgName"); JAXBContext jc = getJAXBContext(pkgName); return jc.createUnmarshaller(); }
/** * Get the JAXB Marshaller * * @param pkgName The package name for the jaxb context * * @return Marshaller * * @throws JAXBException */ public static Marshaller getMarshaller(String pkgName) throws JAXBException { if (pkgName == null) throw logger.nullArgumentError("pkgName"); JAXBContext jc = getJAXBContext(pkgName); Marshaller marshaller = jc.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8"); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.FALSE); // Breaks signatures return marshaller; }
/** * Get the JAXB Unmarshaller for a selected set * of package names * @param pkgNames * @return * @throws JAXBException */ public static Unmarshaller getUnmarshaller(String... pkgNames) throws JAXBException { if (pkgNames == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "pkgName"); int len = pkgNames.length; if (len == 0) return getUnmarshaller(pkgNames[0]); JAXBContext jc = getJAXBContext(pkgNames); return jc.createUnmarshaller(); }
/** * Get the JAXB Unmarshaller for a selected set * of package names * @param pkgNames * @return * @throws JAXBException */ public static Unmarshaller getUnmarshaller(String... pkgNames) throws JAXBException { if (pkgNames == null) throw new IllegalArgumentException(ErrorCodes.NULL_ARGUMENT + "pkgName"); int len = pkgNames.length; if (len == 0) return getUnmarshaller(pkgNames[0]); JAXBContext jc = getJAXBContext(pkgNames); return jc.createUnmarshaller(); }
/** * Get the JAXB Marshaller * * @param pkgName The package name for the jaxb context * * @return Marshaller * * @throws JAXBException */ public static Marshaller getMarshaller(String pkgName) throws JAXBException { if (pkgName == null) throw logger.nullArgumentError("pkgName"); JAXBContext jc = getJAXBContext(pkgName); Marshaller marshaller = jc.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8"); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.FALSE); // Breaks signatures return marshaller; }
/** * Get the JAXB Unmarshaller for a selected set of package names * * @param pkgNames * @return * @throws JAXBException */ public static Unmarshaller getUnmarshaller(String... pkgNames) throws JAXBException { if (pkgNames == null) throw logger.nullArgumentError("pkgName"); int len = pkgNames.length; if (len == 0) return getUnmarshaller(pkgNames[0]); JAXBContext jc = getJAXBContext(pkgNames); return jc.createUnmarshaller(); }
/** * Get the JAXB Unmarshaller for a selected set of package names * * @param pkgNames * * @return * * @throws JAXBException */ public static Unmarshaller getUnmarshaller(String... pkgNames) throws JAXBException { if (pkgNames == null) throw logger.nullArgumentError("pkgName"); int len = pkgNames.length; if (len == 0) return getUnmarshaller(pkgNames[0]); JAXBContext jc = getJAXBContext(pkgNames); return jc.createUnmarshaller(); }