Package org.exolab.castor.mapping

Examples of org.exolab.castor.mapping.Mapping.loadMapping()


                try
                {
                    mapping = new SynchronizedMapping();
                    InputSource is = new InputSource( new FileReader(map) );
                    is.setSystemId( mapFile );
                    mapping.loadMapping( is );
                }
                catch (Exception e)
                {
                    logger.error("Error in psml mapping creation", e);
                    throw new Exception("Error in mapping");
View Full Code Here


        if (xmlContext == null) {
            xmlContext = new XMLContext();

            if (ObjectHelper.isNotEmpty(getMappingFile())) {
                Mapping xmlMap = new Mapping();
                xmlMap.loadMapping(resolver.loadResourceAsURL(getMappingFile()));
                xmlContext.addMapping(xmlMap);
            }

            if (getPackages() != null) {
                xmlContext.addPackages(getPackages());
View Full Code Here

    XMLContext context = new XMLContext();
    if (!ObjectUtils.isEmpty(mappingLocations)) {
      Mapping mapping = new Mapping();
      for (Resource mappingLocation : mappingLocations) {
        mapping.loadMapping(SaxResourceUtils.createInputSource(mappingLocation));
      }
      context.addMapping(mapping);
    }
    if (!ObjectUtils.isEmpty(targetClasses)) {
      context.addClasses(targetClasses);
View Full Code Here

  public CastorDAO() {
    super();
    try {
      this.context = new XMLContext();
      Mapping mapping = new Mapping();
      mapping.loadMapping(getClass().getClassLoader().getResource(
          "resources/xml/gwesm.cas"));
      this.context.addMapping(mapping);
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here

    private static AccountRequestAttrCollection unmarshal(String mappingFile,
                                                          String xmlFile) {
        Mapping mapping = new Mapping();
        Object obj = null;
        try {
            mapping.loadMapping(mappingFile);
            Unmarshaller unmar = new Unmarshaller(mapping);
            obj = unmar.unmarshal(new InputSource(new FileReader(xmlFile)));
        } catch (IOException ioe) {
            throw new AccountRequestAttrException("Couldn't load request form", ioe);
        } catch (MappingException me) {
View Full Code Here

        super.init(config);

        processor = new RequestProcessor();

        Mapping mapping = new Mapping();
        mapping.loadMapping(new InputSource(config.getServletContext().getResourceAsStream("/xml/flex_mapping.xml")));
        unmarshaller = new Unmarshaller(FlexRequest.class);
        try {
            unmarshaller.setMapping(mapping);
        } catch (MappingException e) {
            e.printStackTrace();
View Full Code Here

        try {
            InputStream mappingStream = mappingResource.getInputStream();

            Mapping mapping = new Mapping();
            Unmarshaller unmarshaller = new Unmarshaller(Database.class);
            mapping.loadMapping(new InputSource(mappingStream));
            unmarshaller.setMapping(mapping);

            for (Resource databaseResource : databaseResources) {
                InputStream inputStream = databaseResource.getInputStream();
                Database database = (Database) unmarshaller.unmarshal(new InputSource(inputStream));
View Full Code Here

        if(url == null)
            throw new NullPointerException(
                    "Configuration Error.  Resource: "+WEB_XML_MAPPING+" not found."
            );
        Mapping mapping = new Mapping();
        mapping.loadMapping(url);
        return mapping;
    }

    protected void setCastorMarshallerOptions(Marshaller marshaller, Object beingMarshalled) {
        String servletVersion = ((WebAppDD)beingMarshalled).getServletVersion();
View Full Code Here

            throw new NullPointerException(
                    "Configuration Error.  Resource: "+PORTLET_XML_MAPPING+" not found."
            );
        }
        Mapping mapping = new Mapping();
        mapping.loadMapping(url);
        return mapping;
    }

    protected boolean getIgnoreExtraElements() {
        return true;
View Full Code Here

        if (this.grammarSource.getInputStream()==null)
          throw new ProcessingException("Source '"+this.grammarSource.getURI()+"' not found");

        Mapping mapping = new Mapping();

        mapping.loadMapping(new InputSource(ExtendedGrammar.class.getResource("mapping.xml")
                                                                 .openStream()));

        Unmarshaller unmarshaller = new Unmarshaller(ExtendedGrammar.class);
        unmarshaller.setMapping(mapping);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.