Package javax.xml.bind

Examples of javax.xml.bind.JAXBElement$GlobalScope


          }
        } else {
          val = value.toString();
        }
        QName qname = new QName(column.getNameInSource());
          @SuppressWarnings( "unchecked" )
          JAXBElement jbe = new JAXBElement( qname, stringClazz, val );
        elements.add(jbe);
      }
     
    } catch (TranslatorException ce) {
      exceptions.add(ce);
View Full Code Here


      List<JAXBElement> elements = new ArrayList<JAXBElement>();
      for (SetClause clause : ((Update)command).getChanges()) {
        ColumnReference element = clause.getSymbol();
        Column column = element.getMetadataObject();
        String val = ((Literal) clause.getValue()).toString();
        JAXBElement messageElem = new JAXBElement(new QName(column.getNameInSource()), stringClazz, Util.stripQutes(val));
        elements.add(messageElem);
      }

      List<DataPayload> updateDataList = new ArrayList<DataPayload>();
      for (int i = 0; i < Ids.length; i++) {
View Full Code Here

            Class<?> declaredType = expectedDeclaredTypes[expectedIndex];
            Object value = expectedValues[expectedIndex];
            boolean ret = false;
            expectedIndex++;
            if (obj instanceof JAXBElement) {
                JAXBElement other = (JAXBElement)obj;
                ret = name.equals(other.getName())
                      && declaredType.isAssignableFrom(other.getDeclaredType())
                      && compare(value, other.getValue());
            }
            return ret;
        }
View Full Code Here

   public static String marshalResourceAsString(ManagedConnectionFactoryDeploymentGroup group) throws Exception
   {
      Class[] classes = {ManagedConnectionFactoryDeploymentGroup.class, ManagedConnectionFactoryDeploymentMetaData.class, LocalDataSourceDeploymentMetaData.class, NonXADataSourceDeploymentMetaData.class, DataSourceDeploymentMetaData.class};     
      JAXBContext context = JAXBContext.newInstance(classes);     
      Marshaller m = context.createMarshaller();     
      JAXBElement element = new JAXBElement(new QName("", "datasources"), group.getClass(), group);
      StringWriter w = new StringWriter();
      m.marshal(element, w);     
      return w.toString();     
   }
View Full Code Here

         JAXBContext jaxb = findJAXBContext(type, annotations, mediaType, true);
         Unmarshaller unmarshaller = jaxb.createUnmarshaller();
         Object obj = unmarshaller.unmarshal(entityStream);
         if (obj instanceof JAXBElement)
         {
            JAXBElement element = (JAXBElement) obj;
            return element.getValue();

         }
         else
         {
            return obj;
View Full Code Here

  private Class _cl;

  public Object get(Object obj)
    throws JAXBException
  {
    JAXBElement element = (JAXBElement) obj;

    return element.getValue();
  }
View Full Code Here

  }

  public void set(Object obj, Object value)
    throws JAXBException
  {
    JAXBElement element = (JAXBElement) obj;

    element.setValue(value);
  }
View Full Code Here

    if (skeleton == null) {
      // we strip the JAXBElement when we bind objects, so rewrap
      // the object and try again
      QName qname = JAXBUtil.qnameFromNode(root);

      jaxbObject = new JAXBElement(qname, jaxbObject.getClass(), jaxbObject);

      skeleton = _context.findSkeletonForObject(jaxbObject);

      if (skeleton == null)
        throw new UnmarshalException(L.l("Type {0} is unknown to this context",
View Full Code Here

    throws IOException, XMLStreamException, JAXBException
  {
    if (! (obj instanceof JAXBElement))
      throw new IllegalArgumentException(L.l("Object must be a JAXBElement"));

    JAXBElement element = (JAXBElement) obj;

    _accessor.setType(element.getDeclaredType());

    JAXBElementMapping mapping = (JAXBElementMapping) _value;
    mapping.setQName(element.getName());
    mapping.setProperty(_context.createProperty(element.getDeclaredType()));

    super.write(m, out, obj, namer, attributes);
  }
View Full Code Here

            expectedIndex++;
            if (expectedIndex == 5 && !expectRelatesTo) {
                return true;
            }
            if (obj instanceof JAXBElement) {
                JAXBElement other = (JAXBElement)obj;
                ret = name.equals(other.getName()) && declaredType.isAssignableFrom(other.getDeclaredType())
                      && compare(value, other.getValue());
            }
            return ret;
        }
View Full Code Here

TOP

Related Classes of javax.xml.bind.JAXBElement$GlobalScope

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.