Package com.sun.xml.bind.v2.model.runtime

Examples of com.sun.xml.bind.v2.model.runtime.RuntimeValuePropertyInfo


                    doSet(elBuilder.getBody().getBlock(), beanVar2, beanClass, propRef, retVar);

                }
            } else if (prop instanceof RuntimeValuePropertyInfo) {
              logger.info("Reader: Attributes on simple types are not supported yet!");
                RuntimeValuePropertyInfo propv = (RuntimeValuePropertyInfo) prop;
               
                ElementParserBuilder builder2 = (ElementParserBuilder) classBuilder.newState();
                JVar var = builder2.passParentVariable(beanVar);
               
                handlePropertyElement(builder2, var, beanClass, propv, propv.getTarget().getTypeName(),
                                      true, propv.getTarget());
            } else {
              logger.info("(JAXB Reader) Cannot yet map property " + prop.getName()
                                   + " with type " + prop.getRawType()
                                   + " on " + beanClass
                                   + " for " + prop.getClass().getName());
View Full Code Here


                    logger.info("(JAXB Writer) Attribute lists are not supported yet!");
                } else {
                    writeSimpleTypeAttribute(atBuilder, rawType, c, jt);
                }
            } else if (prop instanceof RuntimeValuePropertyInfo) {
                RuntimeValuePropertyInfo propv = (RuntimeValuePropertyInfo) prop;
               
                Type rawType = propv.getRawType();
                Class c = (Class) propv.getTarget().getType();
                JType jt = getType(rawType);

                JVar var = classBuilder.getCurrentBlock().decl(jt,
                                                               prop.getName(),
                                                               classBuilder.getObject().invoke("getValue"));
               
                writeSimpleTypeElement(classBuilder,
                                       propv.getTarget(),
                                       propv.getAdapter(),
                                       var, true, rawType, c, jt);
            } else if (prop instanceof RuntimeReferencePropertyInfo) {
              RuntimeReferencePropertyInfo propRef = (RuntimeReferencePropertyInfo) prop;
//               
//              Set<? extends RuntimeElement> elements = propRef.getElements();
View Full Code Here

                    doSet(elBuilder.getBody().getBlock(), beanVar2, beanClass, propRef, retVar);

                }
            } else if (prop instanceof RuntimeValuePropertyInfo) {
              logger.info("Reader: Attributes on simple types are not supported yet!");
                RuntimeValuePropertyInfo propv = (RuntimeValuePropertyInfo) prop;
               
                ElementParserBuilder builder2 = (ElementParserBuilder) classBuilder.newState();
                JVar var = builder2.passParentVariable(beanVar);
               
                handlePropertyElement(builder2, var, beanClass, propv, propv.getTarget().getTypeName(),
                                      true, propv.getTarget());
            } else {
              logger.info("(JAXB Reader) Cannot yet map property " + prop.getName()
                                   + " with type " + prop.getRawType()
                                   + " on " + beanClass
                                   + " for " + prop.getClass().getName());
View Full Code Here

/* 209 */     return this.xducer;
/*     */   }
/*     */
/*     */   private Transducer calcTransducer()
/*     */   {
/* 216 */     RuntimeValuePropertyInfo valuep = null;
/* 217 */     if (hasAttributeWildcard())
/* 218 */       return null;
/* 219 */     for (RuntimeClassInfoImpl ci = this; ci != null; ci = ci.getBaseClass()) {
/* 220 */       for (RuntimePropertyInfo pi : ci.getProperties()) {
/* 221 */         if (pi.kind() == PropertyKind.VALUE) {
/* 222 */           valuep = (RuntimeValuePropertyInfo)pi;
/*     */         }
/*     */         else
/* 225 */           return null;
/*     */       }
/*     */     }
/* 228 */     if (valuep == null)
/* 229 */       return null;
/* 230 */     if (!valuep.getTarget().isSimpleType()) {
/* 231 */       return null;
/*     */     }
/* 233 */     return new TransducerImpl((Class)getClazz(), TransducedAccessor.get(((RuntimeModelBuilder)this.builder).context, valuep));
/*     */   }
View Full Code Here

    /**
     * Creates a transducer if this class is bound to a text in XML.
     */
    private Transducer calcTransducer() {
        RuntimeValuePropertyInfo valuep=null;
        if(hasAttributeWildcard())
            return null;        // has attribute wildcard. Can't be handled as a leaf
        for (RuntimeClassInfoImpl ci = this; ci != null; ci = ci.getBaseClass()) {
            for( RuntimePropertyInfo pi : ci.getProperties() )
                if(pi.kind()==PropertyKind.VALUE) {
                    valuep = (RuntimeValuePropertyInfo)pi;
                } else {
                    // this bean has something other than a value
                    return null;
                }
        }
        if(valuep==null)
            return null;
        if( !valuep.getTarget().isSimpleType() )
            return null;    // if there's an error, recover from it by returning null.
       
        return new TransducerImpl(getClazz(),TransducedAccessor.get(
                ((RuntimeModelBuilder)builder).context,valuep));
    }
View Full Code Here

     * {@link XmlAdapter} in such cases.
     */
    private XmlAdapter<OnWireValueT, InMemValueT> staticAdapter;

    private XmlAdapter<OnWireValueT, InMemValueT> getAdapter() {
        Coordinator coordinator = Coordinator._getInstance();
        if(coordinator!=null)
            return coordinator.getAdapter(adapter);
        else {
            synchronized(this) {
                if(staticAdapter==null)
                    staticAdapter = ClassFactory.create(adapter);
            }
View Full Code Here

        if(t==null)     return;

        TypeInfo old = typeNames.put(t,r);
        if(old!=null) {
            // collision
            reportError(new IllegalAnnotationException(
                    Messages.CONFLICTING_XML_TYPE_MAPPING.format(r.getTypeName()),
                    old, r ));
        }
    }
View Full Code Here

  /**
   * @return ordered map contains service, port, operation and messages.
   */
  protected Map<String,Object> getMetadataModelMap(WSEndpoint<?> endPoint,boolean includePortAddress){
    Map<String,Object>     metadataModel   = new TreeMap<String, Object>();
    JAXBContextImpl     context     = (JAXBContextImpl)endPoint.getSEIModel().getJAXBContext();
    Map<String,Object>    service     = new TreeMap<String, Object>();
    metadataModel.put(endPoint.getServiceName().getLocalPart(), service );
   
    // TODO this method gets back all available service and ports.  Filter only specified service.
    Module         modules     = endPoint.getContainer().getSPI(com.sun.xml.ws.api.server.Module.class);
View Full Code Here

  public Message handleMessage(Packet packet,String payloadName) throws Exception{
    Map<String, Object> invocationProperties = packet.invocationProperties;
    boolean OUT_BOUND = invocationProperties.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY) != null &&
              (Boolean)invocationProperties.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
    SEIModel       seiModel   = this.codec.getSEIModel(packet);
    JAXBContextImpl   context   = (JAXBContextImpl)seiModel.getJAXBContext();
    Style style = seiModel.getPort().getBinding().getStyle();
    if(!OUT_BOUND){
      // Request message
      // TODO when operation <input><json:body contains different namespace than port level name space bellow call fails to identify operation.
      WSDLBoundOperation operation   = seiModel.getPort().getBinding().getOperation(seiModel.getTargetNamespace(),payloadName);
      if(operation == null || !packet.invocationProperties.containsKey(JSONCodec.JSON_MAP_KEY)){
        throw new RuntimeException("Operation %s input parameter(s) not found or invalid.");
      }
      JavaMethod       javaMethod   = seiModel.getJavaMethod(operation.getName());
      if(javaMethod == null && javaMethodAccessor != null){
        javaMethod = (JavaMethod) javaMethodAccessor.invoke(seiModel, operation.getName());
      }else{
        // TODO iterate all method and find
      }
      Method         seiMethod   = javaMethod.getSEIMethod();
      JSONWebService  jsonwebService  = javaMethod.getMethod().getAnnotation(JSONWebService.class);
      // Put codec specific properties in invoke
      invocationProperties.put(JSONCodec.globalMapKeyPattern_KEY, (jsonwebService == null || jsonwebService.listMapKey().isEmpty())?
          JSONCodec.globalMapKeyPattern : Pattern.compile(jsonwebService.listMapKey()));
      invocationProperties.put(JSONCodec.globalMapValuePattern_KEY, (jsonwebService == null || jsonwebService.listMapValue().isEmpty())?
          JSONCodec.globalMapValuePattern : Pattern.compile(jsonwebService.listMapValue()));
      //
     
      Map<String,Object>   operationParameters = (Map<String, Object>) invocationProperties.remove(JSONCodec.JSON_MAP_KEY);
     
      WSJSONPopulator   jsonPopulator     = new WSJSONPopulator((Pattern)invocationProperties.get(JSONCodec.globalMapKeyPattern_KEY),
          (Pattern)invocationProperties.get(JSONCodec.globalMapValuePattern_KEY),JSONCodec.dateFormat,
          codec.getCustomSerializer()
          ,(DebugTrace)invocationProperties.get(JSONCodec.TRACE));
     
      Object[]      parameterObjects  = new Object[operation.getInParts().size()];
      Class<?>[]       parameterTypes     = seiMethod.getParameterTypes();// This parameter types not trustable in case of HOLDER
      for(Map.Entry<String, WSDLPart> part : operation.getInParts().entrySet()){
        Class<?>     parameterType;
        if(context.getGlobalType(part.getValue().getDescriptor().name()) != null)
          parameterType = context.getGlobalType(part.getValue().getDescriptor().name()).jaxbType;
        else
          /*
           * This parameter types not trustable in case of HOLDER
           * We can't find it in global type once user extend simple type and use it as method parameter.
           * E.g String255 extended from String
View Full Code Here

   * Process document for response.
   */
  public void process() {
    if(!endPointDocuments.containsKey(this.codec.getEndpoint().getPortName())){
      WSEndpoint<?>     endPoint   = codec.getEndpoint();
      JAXBContextImpl   context   = (JAXBContextImpl)endPoint.getSEIModel().getJAXBContext();
      Properties      templates   = new Properties();
      try {
        templates.load(JSONHttpMetadataPublisher.class.getResourceAsStream("codec.properties"));
      } catch (IOException e) {
        return;
View Full Code Here

TOP

Related Classes of com.sun.xml.bind.v2.model.runtime.RuntimeValuePropertyInfo

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.