• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java MetadataReader类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.xml.internal.ws.api.databinding.MetadataReader的典型用法代码示例。如果您正苦于以下问题:Java MetadataReader类的具体用法?Java MetadataReader怎么用?Java MetadataReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MetadataReader类属于com.sun.xml.internal.ws.api.databinding包,在下文中一共展示了MetadataReader类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setWsaActions

import com.sun.xml.internal.ws.api.databinding.MetadataReader; //导入依赖的package包/类
private void setWsaActions(MetadataReader metadataReader) {
    Action action = (metadataReader != null)? metadataReader.getAnnotation(Action.class, seiMethod):seiMethod.getAnnotation(Action.class);
    if(action != null) {
        inputAction = action.input();
        outputAction = action.output();
    }

    //@Action(input) =="", get it from @WebMethod(action)
    WebMethod webMethod = (metadataReader != null)? metadataReader.getAnnotation(WebMethod.class, seiMethod):seiMethod.getAnnotation(WebMethod.class);
    soapAction = "";
    if (webMethod != null )
        soapAction = webMethod.action();
    if(!soapAction.equals("")) {
        //non-empty soapAction
        if(inputAction.equals(""))
            // set input action to non-empty soapAction
            inputAction = soapAction;
        else if(!inputAction.equals(soapAction)){
            //both are explicitly set via annotations, make sure @Action == @WebMethod.action
            //http://java.net/jira/browse/JAX_WS-1108
          //throw new WebServiceException("@Action and @WebMethod(action=\"\" does not match on operation "+ method.getName());
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:JavaMethodImpl.java


示例2: getDefaultServiceName

import com.sun.xml.internal.ws.api.databinding.MetadataReader; //导入依赖的package包/类
public static @NotNull QName getDefaultServiceName(Class<?> implType, boolean isStandard, MetadataReader metadataReader) {
    if (metadataReader == null) {
        metadataReader = new ReflectAnnotationReader();
    }
    QName serviceName;
    WebServiceProvider wsProvider = metadataReader.getAnnotation(WebServiceProvider.class, implType);
    if (wsProvider!=null) {
        String tns = wsProvider.targetNamespace();
        String local = wsProvider.serviceName();
        serviceName = new QName(tns, local);
    } else {
        serviceName = RuntimeModeler.getServiceName(implType, metadataReader, isStandard);
    }
    assert serviceName != null;
    return serviceName;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:EndpointFactory.java


示例3: getDefaultPortName

import com.sun.xml.internal.ws.api.databinding.MetadataReader; //导入依赖的package包/类
public static @NotNull QName getDefaultPortName(QName serviceName, Class<?> implType, boolean isStandard, MetadataReader metadataReader) {
    if (metadataReader == null) {
        metadataReader = new ReflectAnnotationReader();
    }
    QName portName;
    WebServiceProvider wsProvider = metadataReader.getAnnotation(WebServiceProvider.class, implType);
    if (wsProvider!=null) {
        String tns = wsProvider.targetNamespace();
        String local = wsProvider.portName();
        portName = new QName(tns, local);
    } else {
        portName = RuntimeModeler.getPortName(implType, metadataReader, serviceName.getNamespaceURI(), isStandard);
    }
    assert portName != null;
    return portName;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:EndpointFactory.java


示例4: getWsdlLocation

import com.sun.xml.internal.ws.api.databinding.MetadataReader; //导入依赖的package包/类
/**
 * Returns the wsdl from @WebService, or @WebServiceProvider annotation using
 * wsdlLocation element.
 *
 * @param implType
 *      endpoint implementation class
 *      make sure that you called {@link #verifyImplementorClass} on it.
 * @return wsdl if there is wsdlLocation, else null
 */
public static @Nullable String getWsdlLocation(Class<?> implType, MetadataReader metadataReader) {

    if (metadataReader == null) {
        metadataReader = new ReflectAnnotationReader();
    }

    WebService ws = metadataReader.getAnnotation(WebService.class, implType);
    if (ws != null) {
        return nullIfEmpty(ws.wsdlLocation());
    } else {
        WebServiceProvider wsProvider = implType.getAnnotation(WebServiceProvider.class);
        assert wsProvider != null;
        return nullIfEmpty(wsProvider.wsdlLocation());
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:EndpointFactory.java


示例5: property

import com.sun.xml.internal.ws.api.databinding.MetadataReader; //导入依赖的package包/类
public Builder property(String name, Object value) {
    config.properties().put(name, value);
    if (isfor(BindingID.class, name, value)) {
        config.getMappingInfo().setBindingID((BindingID)value);
    }
    if (isfor(WSBinding.class, name, value)) {
        config.setWSBinding((WSBinding)value);
    }
    if (isfor(WSDLPort.class, name, value)) {
        config.setWsdlPort((WSDLPort)value);
    }
    if (isfor(MetadataReader.class, name, value)) {
        config.setMetadataReader((MetadataReader)value);
    }
    return this;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:DatabindingFactoryImpl.java


示例6: JavaMethodImpl

import com.sun.xml.internal.ws.api.databinding.MetadataReader; //导入依赖的package包/类
/**
 * @param owner
 * @param method : Implementation class method
 * @param seiMethod : corresponding SEI Method.
 *                  Is there is no SEI, it should be Implementation class method
 */
public JavaMethodImpl(AbstractSEIModelImpl owner, Method method, Method seiMethod, MetadataReader metadataReader) {
    this.owner = owner;
    this.method = method;
    this.seiMethod = seiMethod;
    setWsaActions(metadataReader);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:JavaMethodImpl.java


示例7: getServiceName

import com.sun.xml.internal.ws.api.databinding.MetadataReader; //导入依赖的package包/类
public static QName getServiceName(Class<?> implClass, MetadataReader reader, boolean isStandard) {
    if (implClass.isInterface()) {
        throw new RuntimeModelerException("runtime.modeler.cannot.get.serviceName.from.interface",
                                implClass.getCanonicalName());
    }

    String name = implClass.getSimpleName()+SERVICE;
    String packageName = "";
    if (implClass.getPackage() != null)
        packageName = implClass.getPackage().getName();

    WebService webService = getAnnotation(WebService.class, implClass, reader);
    if (isStandard && webService == null) {
        throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation",
            implClass.getCanonicalName());
    }
    if (webService != null && webService.serviceName().length() > 0) {
        name = webService.serviceName();
    }
    String targetNamespace = getNamespace(packageName);
    if (webService != null && webService.targetNamespace().length() > 0) {
        targetNamespace = webService.targetNamespace();
    } else if (targetNamespace == null) {
        throw new RuntimeModelerException("runtime.modeler.no.package",
            implClass.getName());
    }
    return new QName(targetNamespace, name);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:RuntimeModeler.java


示例8: getPortName

import com.sun.xml.internal.ws.api.databinding.MetadataReader; //导入依赖的package包/类
public static QName getPortName(Class<?> implClass, MetadataReader reader, String targetNamespace, boolean isStandard) {
    WebService webService = getAnnotation(WebService.class, implClass, reader);
    if (isStandard && webService == null) {
        throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation",
            implClass.getCanonicalName());
    }
    String name;
    if (webService != null && webService.portName().length() > 0) {
        name = webService.portName();
    } else if (webService != null && webService.name().length() > 0) {
        name = webService.name()+PORT;
    } else {
        name = implClass.getSimpleName()+PORT;
    }

    if (targetNamespace == null) {
        if (webService != null && webService.targetNamespace().length() > 0) {
            targetNamespace = webService.targetNamespace();
        } else {
            String packageName = null;
            if (implClass.getPackage() != null) {
                packageName = implClass.getPackage().getName();
            }
            if (packageName != null) {
                targetNamespace = getNamespace(packageName);
            }
            if (targetNamespace == null) {
                throw new RuntimeModelerException("runtime.modeler.no.package",
                    implClass.getName());
            }
        }

    }

    return new QName(targetNamespace, name);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:37,代码来源:RuntimeModeler.java


示例9: getPortTypeName

import com.sun.xml.internal.ws.api.databinding.MetadataReader; //导入依赖的package包/类
public static QName getPortTypeName(Class<?> implOrSeiClass, String tns, MetadataReader reader){
    assert(implOrSeiClass != null);
    WebService webService = getAnnotation(WebService.class, implOrSeiClass, reader);
    Class<?> clazz = implOrSeiClass;
    if (webService == null)
            throw new RuntimeModelerException("runtime.modeler.no.webservice.annotation",
                                       implOrSeiClass.getCanonicalName());

    if (!implOrSeiClass.isInterface()) {
        String epi = webService.endpointInterface();
        if (epi.length() > 0) {
            try {
                clazz = Thread.currentThread().getContextClassLoader().loadClass(epi);
            } catch (ClassNotFoundException e) {
                throw new RuntimeModelerException("runtime.modeler.class.not.found", epi);
            }
            WebService ws = getAnnotation(WebService.class, clazz, reader);
            if (ws == null) {
                throw new RuntimeModelerException("runtime.modeler.endpoint.interface.no.webservice",
                                    webService.endpointInterface());
            }
        }
    }

    webService = getAnnotation(WebService.class, clazz, reader);
    String name = webService.name();
    if(name.length() == 0){
        name = clazz.getSimpleName();
    }
    if (tns == null || "".equals(tns.trim())) tns = webService.targetNamespace();
    if (tns.length() == 0)
        tns = getNamespace(clazz.getPackage().getName());
    if (tns == null) {
        throw new RuntimeModelerException("runtime.modeler.no.package", clazz.getName());
    }
    return new QName(tns, name);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:RuntimeModeler.java


示例10: getMetadadaReader

import com.sun.xml.internal.ws.api.databinding.MetadataReader; //导入依赖的package包/类
private MetadataReader getMetadadaReader(WebServiceFeatureList features, ClassLoader classLoader) {
    if (features == null) return null;
    com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature ef =
            features.get(com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature.class);
    // TODO-Miran: would it be necessary to disable secure xml processing?
    if (ef != null)
        return ef.getMetadataReader(classLoader, false);
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:WSServiceDelegate.java


示例11: getPrimaryWSDL

import com.sun.xml.internal.ws.api.databinding.MetadataReader; //导入依赖的package包/类
/**
 * Checks the deployment descriptor or {@link @WebServiceProvider} annotation
 * to see if it points to any WSDL. If so, returns the {@link SDDocumentSource}.
 *
 * @return The pointed WSDL, if any. Otherwise null.
 */
private SDDocumentSource getPrimaryWSDL(XMLStreamReader xsr, Attributes attrs, Class<?> implementorClass, MetadataReader metadataReader) {

    String wsdlFile = getAttribute(attrs, ATTR_WSDL);
    if (wsdlFile == null) {
        wsdlFile = EndpointFactory.getWsdlLocation(implementorClass, metadataReader);
    }

    if (wsdlFile != null) {
        if (!wsdlFile.startsWith(JAXWS_WSDL_DD_DIR)) {
            logger.log(Level.WARNING, "Ignoring wrong wsdl={0}. It should start with {1}. Going to generate and publish a new WSDL.", new Object[]{wsdlFile, JAXWS_WSDL_DD_DIR});
            return null;
        }

        URL wsdl;
        try {
            wsdl = loader.getResource('/' + wsdlFile);
        } catch (MalformedURLException e) {
            throw new LocatableWebServiceException(
                    ServerMessages.RUNTIME_PARSER_WSDL_NOT_FOUND(wsdlFile), e, xsr);
        }
        if (wsdl == null) {
            throw new LocatableWebServiceException(
                    ServerMessages.RUNTIME_PARSER_WSDL_NOT_FOUND(wsdlFile), xsr);
        }
        SDDocumentSource docInfo = docs.get(wsdl.toExternalForm());
        assert docInfo != null;
        return docInfo;
    }

    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:DeploymentDescriptorParser.java


示例12: createEndpoint

import com.sun.xml.internal.ws.api.databinding.MetadataReader; //导入依赖的package包/类
private void createEndpoint(String urlPattern) {
    // Checks permission for "publishEndpoint"
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(ENDPOINT_PUBLISH_PERMISSION);
    }

    // See if HttpServer implementation is available
    try {
        Class.forName("com.sun.net.httpserver.HttpServer");
    } catch (Exception e) {
        throw new UnsupportedOperationException("Couldn't load light weight http server", e);
    }
    container = getContainer();
    MetadataReader metadataReader = EndpointFactory.getExternalMetadatReader(implClass, binding);
    WSEndpoint wse = WSEndpoint.create(
            implClass, true,
            invoker,
            getProperty(QName.class, Endpoint.WSDL_SERVICE),
            getProperty(QName.class, Endpoint.WSDL_PORT),
            container,
            binding,
            getPrimaryWsdl(metadataReader),
            buildDocList(),
            (EntityResolver) null,
            false
    );
    // Don't load HttpEndpoint class before as it may load HttpServer classes
    actualEndpoint = new HttpEndpoint(executor, getAdapter(wse, urlPattern));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:EndpointImpl.java


示例13: getPrimaryWsdl

import com.sun.xml.internal.ws.api.databinding.MetadataReader; //导入依赖的package包/类
/**
 * Gets wsdl from @WebService or @WebServiceProvider
 */
private @Nullable SDDocumentSource getPrimaryWsdl(MetadataReader metadataReader) {
    // Takes care of @WebService, @WebServiceProvider's wsdlLocation
    EndpointFactory.verifyImplementorClass(implClass, metadataReader);
    String wsdlLocation = EndpointFactory.getWsdlLocation(implClass, metadataReader);
    if (wsdlLocation != null) {
        ClassLoader cl = implClass.getClassLoader();
        URL url = cl.getResource(wsdlLocation);
        if (url != null) {
            return SDDocumentSource.create(url);
        }
        throw new ServerRtException("cannot.load.wsdl", wsdlLocation);
    }
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:EndpointImpl.java


示例14: getExternalMetadatReader

import com.sun.xml.internal.ws.api.databinding.MetadataReader; //导入依赖的package包/类
public static MetadataReader getExternalMetadatReader(Class<?> implType, WSBinding binding) {
    com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature ef = binding.getFeature(
            com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature.class);
    // TODO-Miran: would it be necessary to disable secure xml processing?
    if (ef != null)
        return ef.getMetadataReader(implType.getClassLoader(), false);
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:EndpointFactory.java



注:本文中的com.sun.xml.internal.ws.api.databinding.MetadataReader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Hashcypher类代码示例发布时间:2022-05-23
下一篇:
Java ActionableDynamicQuery类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap