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

Examples of com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl


     * {@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


    @Override
    public Accessor getElementPropertyAccessor(String nsUri, String localName) {
        JaxBeanInfo bi = expectedElements.get(nsUri, localName);
        if(bi!=null) {
            if(bi instanceof ElementBeanInfoImpl) {
                final ElementBeanInfoImpl ebi = (ElementBeanInfoImpl) bi;
                // a JAXBElement. We need to handle JAXBElement for JAX-WS
                return new Accessor<BeanT,Object>(ebi.expectedType) {
                    public Object get(BeanT bean) throws AccessorException {
                        ValueT r = acc.get(bean);
                        if(r instanceof JAXBElement) {
                            return ((JAXBElement)r).getValue();
                        } else
                            // this is sloppy programming, but hey...
                            return r;
                    }

                    public void set(BeanT bean, Object value) throws AccessorException {
                        if(value!=null) {
                            value = ebi.createInstanceFromValue(value);
                        }
                        acc.set(bean,(ValueT)value);
                    }
                };
            } else {
View Full Code Here

    @Override
    public Accessor getElementPropertyAccessor(String nsUri, String localName) {
        JaxBeanInfo bi = expectedElements.get(nsUri, localName);
        if(bi!=null) {
            if(bi instanceof ElementBeanInfoImpl) {
                final ElementBeanInfoImpl ebi = (ElementBeanInfoImpl) bi;
                // a JAXBElement. We need to handle JAXBElement for JAX-WS
                return new Accessor<BeanT,Object>(ebi.expectedType) {
                    public Object get(BeanT bean) throws AccessorException {
                        ValueT r = acc.get(bean);
                        if(r instanceof JAXBElement) {
                            return ((JAXBElement)r).getValue();
                        } else
                            // this is sloppy programming, but hey...
                            return r;
                    }

                    public void set(BeanT bean, Object value) throws AccessorException {
                        if(value!=null) {
                            try {
                                value = ebi.createInstanceFromValue(value);
                            } catch (IllegalAccessException e) {
                                throw new AccessorException(e);
                            } catch (InvocationTargetException e) {
                                throw new AccessorException(e);
                            } catch (InstantiationException e) {
View Full Code Here

/*     */   public Accessor getElementPropertyAccessor(String nsUri, String localName)
/*     */   {
/* 134 */     JaxBeanInfo bi = (JaxBeanInfo)this.expectedElements.get(nsUri, localName);
/* 135 */     if (bi != null) {
/* 136 */       if ((bi instanceof ElementBeanInfoImpl)) {
/* 137 */         ElementBeanInfoImpl ebi = (ElementBeanInfoImpl)bi;
/*     */
/* 139 */         return new Accessor(ebi.expectedType, ebi) {
/*     */           public Object get(BeanT bean) throws AccessorException {
/* 141 */             Object r = SingleReferenceNodeProperty.this.acc.get(bean);
/* 142 */             if ((r instanceof JAXBElement)) {
View Full Code Here

    @Override
    public Accessor getElementPropertyAccessor(String nsUri, String localName) {
        JaxBeanInfo bi = expectedElements.get(nsUri, localName);
        if(bi!=null) {
            if(bi instanceof ElementBeanInfoImpl) {
                final ElementBeanInfoImpl ebi = (ElementBeanInfoImpl) bi;
                // a JAXBElement. We need to handle JAXBElement for JAX-WS
                return new Accessor<BeanT,Object>(ebi.expectedType) {
                    public Object get(BeanT bean) throws AccessorException {
                        ValueT r = acc.get(bean);
                        if(r instanceof JAXBElement) {
                            return ((JAXBElement)r).getValue();
                        } else
                            // this is sloppy programming, but hey...
                            return r;
                    }

                    public void set(BeanT bean, Object value) throws AccessorException {
                        if(value!=null) {
                            try {
                                value = ebi.createInstanceFromValue(value);
                            } catch (IllegalAccessException e) {
                                throw new AccessorException(e);
                            } catch (InvocationTargetException e) {
                                throw new AccessorException(e);
                            } catch (InstantiationException e) {
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

  /**
   * Init configuration holder
   */
  public void process() {
    WSEndpoint<?>     endPoint     = this.codec.getEndpoint();
    JAXBContextImpl   context     = (JAXBContextImpl)endPoint.getSEIModel().getJAXBContext();
   
    WSDLPort port = endPoint.getPort();
    if (!operationDocuments.containsKey(port.getBinding().getName())) {
      BufferedReader ins = new BufferedReader(new InputStreamReader(
      MethodFormProvider.class.getResourceAsStream("methodForm.htm")));
View Full Code Here

TOP

Related Classes of com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl

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.