org.codehaus.enunciate.config.WsdlInfo.getProperty()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(93)

本文整理了Java中org.codehaus.enunciate.config.WsdlInfo.getProperty()方法的一些代码示例,展示了WsdlInfo.getProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WsdlInfo.getProperty()方法的具体详情如下:
包路径:org.codehaus.enunciate.config.WsdlInfo
类名称:WsdlInfo
方法名:getProperty

WsdlInfo.getProperty介绍

[英]Get a property value.
[中]获取属性值。

代码示例

代码示例来源:origin: org.codehaus.enunciate/enunciate-full

@Override
 public TemplateModel get(String key) throws TemplateModelException {
  if (("filename".equals(key)) || ("location".equals(key)) || ("inlineSchema".equals(key))) {
   return wrap(wsdlInfo.getProperty(key));
  }
  else if ("importedNamespaces".equals(key)) {
   Set<String> importedNamespaces = wsdlInfo.getImportedNamespaces();
   SchemaInfo associatedSchema = wsdlInfo.getAssociatedSchema();
   Boolean inlineSchema = (Boolean) wsdlInfo.getProperty("inlineSchema");
   if (associatedSchema != null && inlineSchema != null && inlineSchema) {
    importedNamespaces.addAll(associatedSchema.getReferencedNamespaces());
   }
   return wrap(importedNamespaces);
  }
  else if ("importedSchemas".equals(key)) {
   TreeSet<SchemaInfo> schemas = new TreeSet<SchemaInfo>(new SchemaInfoComparator());
   schemas.addAll(wsdlInfo.getImportedSchemas());
   SchemaInfo associatedSchema = wsdlInfo.getAssociatedSchema();
   Boolean inlineSchema = (Boolean) wsdlInfo.getProperty("inlineSchema");
   if (associatedSchema != null && inlineSchema != null && inlineSchema) {
    schemas.addAll(associatedSchema.getImportedSchemas());
   }
   return wrap(schemas);
  }

  return super.get(key);
 }
}

代码示例来源:origin: org.codehaus.enunciate/enunciate-docs

@Override
public void initModel(EnunciateFreemarkerModel model) {
 super.initModel(model);
 if (!getModelInternal().getNamespacesToWSDLs().isEmpty()) {
  String docsDir = getDocsDir() == null ? "" : getDocsDir();
  if (!docsDir.startsWith("/")) {
   docsDir = "/" + docsDir;
  }
  while (docsDir.endsWith("/")) {
   docsDir = docsDir.substring(0, docsDir.length() - 1);
  }
  for (WsdlInfo wsdlInfo : getModelInternal().getNamespacesToWSDLs().values()) {
   Object filename = wsdlInfo.getProperty("filename");
   if (filename != null) {
    wsdlInfo.setProperty("redirectLocation", docsDir + "/" + filename);
   }
  }
 }
 EnunciateConfiguration config = model.getEnunciateConfig();
 for (RootResource resource : model.getRootResources()) {
  for (ResourceMethod resourceMethod : resource.getResourceMethods(true)) {
   if (!resourceMethod.getMetaData().containsKey("defaultSubcontext")) {
    //if we don't have the defaultSubcontext set by some other jax-rs implementation provider module
    //then we need to set it ourselves.
    resourceMethod.putMetaData("defaultSubcontext", config == null ? "/rest" : config.getDefaultRestSubcontext());
   }
  }
 }
}

代码示例来源:origin: org.codehaus.enunciate/enunciate-docs

if (wsdlInfo.getProperty("file") != null) {
 File from = (File) wsdlInfo.getProperty("file");
 String filename = wsdlInfo.getProperty("filename") != null ? (String) wsdlInfo.getProperty("filename") : from.getName();
 File to = new File(getDocsBuildDir(), filename);
 enunciate.copyFile(from, to);

代码示例来源:origin: org.codehaus.enunciate/enunciate-full

if (wsdlInfo.getProperty("file") != null) {
 File from = (File) wsdlInfo.getProperty("file");
 String filename = wsdlInfo.getProperty("filename") != null ? (String) wsdlInfo.getProperty("filename") : from.getName();
 File to = new File(getBuildDir(), filename);
 enunciate.copyFile(from, to);

代码示例来源:origin: org.codehaus.enunciate/enunciate-docs

String wsdlLocation = (String) wsdlInfo.getProperty("redirectLocation");
if (wsdlLocation != null) {
 wsdls.add(wsdlLocation);

代码示例来源:origin: org.codehaus.enunciate/enunciate-full

String file = (String) wsdl.getProperty("filename");
File wsdlFile = new File(artifactDir, file);
wsdl.setProperty("file", wsdlFile);

代码示例来源:origin: org.codehaus.enunciate/enunciate-java-client

if (wsdlInfo.getProperty("filename") == null) {
 throw new EnunciateException("WSDL " + wsdlInfo.getId() + " doesn't have a filename.");
model.put("wsdlFileName", wsdlInfo.getProperty("filename"));

相关文章