Package javax.xml.bind

Examples of javax.xml.bind.JAXBException


        element.getNamespaceURI();
        EasyMock.expectLastCall().andReturn(testURI);
        element.getLocalName();
        EasyMock.expectLastCall().andReturn(typename);
        ts.unmarshal(new QName(testURI, typename), element);
        EasyMock.expectLastCall().andThrow(new JAXBException("test"));
        EasyMock.replay(element);
        org.easymock.classextension.EasyMock.replay(ts);
        try {
            pe.getValue();
            fail("Expected ConfigurationException not thrown.");
View Full Code Here


                       config.schema());
               schema = schemaFactory.newSchema(new StreamSource(in));
            }
            catch (SAXException e)
            {
               throw new JAXBException("Error wil trying to load schema for " + config.schema(), e);
            }
         }

      }
   }
View Full Code Here

        it.remove();
      }
    }

    if (members.size() > 1)
      throw new JAXBException("More than one member declared with XmlValue on" + bean);
   
    return members.size() == 1 ? this.createRealType(members.get(0), context) : null;
  }
View Full Code Here

        it.remove();
      }
    }

    if (members.size() > 1)
      throw new JAXBException("More than one member declared with XmlValue on" + bean);
   
    return members.size() == 1 ? new JavaXMLContent(members.get(0)) : null;
  }
View Full Code Here

  protected IJavaXMLElement createRealType (IClassMemberWritableValue member, JavaXMLBeanInitializationContext context) throws JAXBException {
    if (Collection.class.isAssignableFrom(member.getBaseType())) {
      Class<?> realType = ReflectionUtil.getConcreteGeneric(member.getGenericType(), 0);
     
      if (realType == null) {
        throw new JAXBException("Could not determine real collection type for: " + member);
      }
     
      XmlElementWrapper wrapper = member.getAnnotation(XmlElementWrapper.class);
      String wname = wrapper != null ? ("".equals(wrapper.name()) ? member.getName() : wrapper.name()) : null;
     
View Full Code Here

      ((Collection)value).add(item);
    } else if (value instanceof Appendable) {
      try {
        ((Appendable)value).append(new String(buffer, offset, length));
      } catch (IOException e) {
        throw new JAXBException(e);
      }
    } else if (Writer.class.isAssignableFrom(member.getBaseType())) {
      try {
        ((Writer)value).write(buffer, offset, length);
      } catch (IOException e) {
        throw new JAXBException(e);
      }
    } else {
      String str = new String(buffer, offset, length);
     
      if (cumulative && value != null) {
View Full Code Here

     
      writer.flush();
     
      return output;
    } catch (IOException e) {
      throw new JAXBException(e);
    }
  }
View Full Code Here

    }
    catch (JAXBException e) {
      throw e;
    }
    catch (Exception e) {
      throw new JAXBException(e);
    }
  }
View Full Code Here

      }
      else
        _collectionConstructor = collectionType.getConstructor();
    }
    catch (Exception e) {
      throw new JAXBException(e);
    }

    if (_collectionConstructor == null)
      throw new JAXBException(L.l("Cannot instantiate interface or abstract class: {0}", collectionType));
  }
View Full Code Here

    }
    catch (JAXBException e) {
      throw e;
    }
    catch (Exception e) {
      throw new JAXBException(e);
    }
  }
View Full Code Here

TOP

Related Classes of javax.xml.bind.JAXBException

Copyright © 2018 www.massapicom. 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.