org.geotools.util.Version.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(104)

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

Version.<init>介绍

[英]Creates a new version object from the supplied string.
[中]从提供的字符串创建新版本对象。

代码示例

代码示例来源:origin: geoserver/geoserver

/**
 * Returns the format version for the specified mime type.
 *
 * <p>This method should only be overriden by formats that support multiple versions. The
 * default implementation just returns 1.0.0.
 */
public Version versionForMimeType(String mimeType) {
  return new Version("1.0.0");
}

代码示例来源:origin: geoserver/geoserver

/**
 * Determines the version of the format/language of the specified style resource.
 *
 * <p>This method should only be overriden by formats that support multiple versions. The
 * default implementation just returns 1.0.0.
 *
 * @param input The style input, see {@link #toReader(Object)} for accepted inputs.
 */
public Version version(Object input) throws IOException {
  return new Version("1.0.0");
}

代码示例来源:origin: geoserver/geoserver

/** Supported format versions. */
public List<Version> getVersions() {
  return Arrays.asList(new Version("1.0.0"));
}

代码示例来源:origin: geoserver/geoserver

public OWS11AcceptVersionsKvpParser() {
  super("AcceptVersions", AcceptVersionsType.class);
  setVersion(new Version("1.1.1"));
}

代码示例来源:origin: geoserver/geoserver

public void setAsText(String text) throws IllegalArgumentException {
    setValue(new Version(text));
  }
}

代码示例来源:origin: geoserver/geoserver

public MessageXmlParser() {
  this(null, new Version("1.0.0"));
}

代码示例来源:origin: geoserver/geoserver

public WCSInfo load(LegacyServicesReader reader, GeoServer gs) throws Exception {
  WCSInfoImpl wcs = new WCSInfoImpl();
  wcs.setId("wcs");
  Map<String, Object> map = reader.wcs();
  readCommon(wcs, map, gs);
  // wcs.setGMLPrefixing((Boolean)map.get( "gmlPrefixing"));
  wcs.getVersions().add(new Version("1.0.0"));
  wcs.getVersions().add(new Version("1.1.1"));
  return wcs;
}

代码示例来源:origin: geoserver/geoserver

provided.add(new Version(v));
checkVersionNumber(v, "AcceptVersions");
accepted.add(new Version(v));

代码示例来源:origin: geoserver/geoserver

@Override
  protected WCSInfo initialize(WCSInfo service) {
    super.initialize(service);
    if (service.getExceptionFormats() == null) {
      ((WCSInfoImpl) service).setExceptionFormats(new ArrayList<String>());
    }
    if (service.getVersions().isEmpty()) {
      service.getVersions().add(new Version("1.0.0"));
      service.getVersions().add(new Version("1.1.1"));
    }
    Version v201 = new Version("2.0.1");
    if (!service.getVersions().contains(v201)) {
      service.getVersions().add(v201);
    }
    if (service.getSRS() == null) {
      ((WCSInfoImpl) service).setSRS(new ArrayList<String>());
    }
    return service;
  }
}

代码示例来源:origin: geoserver/geoserver

provided.add(new Version(v));
  checkVersionNumber(v, null);
  accepted.add(new Version(v));
} else {
  for (String v : acceptedList) {
    accepted.add(new Version(v));

代码示例来源:origin: geoserver/geoserver

private Version getSecurityVersion() throws IOException {
  Resource security = security();
  if (security.getType() == Type.UNDEFINED) {
    return BASE_VERSION;
  }
  Resource properties = security.get(VERSION_PROPERTIES);
  if (properties.getType() == Type.UNDEFINED) {
    return BASE_VERSION;
  }
  Properties p = new Properties();
  try (InputStream is = properties.in()) {
    p.load(is);
  }
  String version = p.getProperty(VERSION);
  if (version != null) {
    return new Version(version);
  } else {
    return BASE_VERSION;
  }
}

代码示例来源:origin: geoserver/geoserver

/**
 * Normalize the version, handling cases like forcing "x.y" to "x.y.z".
 *
 * @param version
 * @return normalized version
 */
public static String normalizeVersion(String version) {
  if (version == null) {
    return null;
  }
  Version v = new Version(version);
  if (v.getMajor() == null) {
    return null;
  }
  if (v.getMinor() == null) {
    return String.format("%d.0.0", ((Number) v.getMajor()).intValue());
  }
  if (v.getRevision() == null) {
    return String.format(
        "%d.%d.0",
        ((Number) v.getMajor()).intValue(), ((Number) v.getMinor()).intValue());
  }
  // version ok
  return version;
}

代码示例来源:origin: geoserver/geoserver

return new Object[] {new Version(version), reader};

代码示例来源:origin: geoserver/geoserver

"directCallService",
        serviceBean,
        new Version("1.0.0"),
        Collections.singletonList("concat"));
Method method = serviceBean.getClass().getMethod("concat", String.class, String.class);

代码示例来源:origin: geoserver/geoserver

@Test
public void testParsedStyle() throws IOException {
  File styleDir = new File(dataDir.root(), "styles");
  styleDir.mkdir();
  // Copy the sld to the temp style dir
  File styleFile = new File(styleDir, "external.sld");
  Files.copy(this.getClass().getResourceAsStream("external.sld"), styleFile.toPath());
  File iconFile = new File(styleDir, "icon.png");
  assertFalse(iconFile.exists());
  StyleInfoImpl si = new StyleInfoImpl(null);
  si.setName("");
  si.setId("");
  si.setFormat("sld");
  si.setFormatVersion(new Version("1.0.0"));
  si.setFilename(styleFile.getName());
  Style s = dataDir.parsedStyle(si);
  // Verify style is actually parsed correctly
  Symbolizer symbolizer = s.featureTypeStyles().get(0).rules().get(0).symbolizers().get(0);
  assertTrue(symbolizer instanceof PointSymbolizer);
  GraphicalSymbol graphic =
      ((PointSymbolizer) symbolizer).getGraphic().graphicalSymbols().get(0);
  assertTrue(graphic instanceof ExternalGraphic);
  assertEquals(((ExternalGraphic) graphic).getLocation(), iconFile.toURI().toURL());
  // GEOS-7025: verify the icon file is not created if it doesn't already exist
  assertFalse(iconFile.exists());
}

代码示例来源:origin: geoserver/geoserver

si.setId("");
si.setFormat("sld");
si.setFormatVersion(new Version("1.0.0"));
si.setFilename(styleFile.getName());

代码示例来源:origin: geoserver/geoserver

si.setId("");
si.setFormat("sld");
si.setFormatVersion(new Version("1.0.0"));
si.setFilename(styleFile.getName());

代码示例来源:origin: geoserver/geoserver

protected void setUp() throws Exception {
  super.setUp();
  HelloWorld helloWorld = new HelloWorld();
  Service service =
      new Service(
          "hello",
          helloWorld,
          new Version("1.0.0"),
          Collections.singletonList("hello"));
  request =
      new MockHttpServletRequest() {
        public int getServerPort() {
          return 8080;
        }
      };
  request.setScheme("http");
  request.setServerName("localhost");
  request.setContextPath("geoserver");
  response = new MockHttpServletResponse();
  handler = new DefaultServiceExceptionHandler();
  requestInfo = new Request();
  requestInfo.setHttpRequest(request);
  requestInfo.setHttpResponse(response);
  requestInfo.setService("hello");
  requestInfo.setVersion("1.0.0");
}

代码示例来源:origin: geoserver/geoserver

@Override
protected void onSetUp(SystemTestData testData) throws Exception {
  super.onSetUp(testData);
  testData.addStyle("relative", "se_relativepath.sld", ResourcePoolTest.class, getCatalog());
  testData.addStyle(
      "relative_protocol",
      "se_relativepath_protocol.sld",
      ResourcePoolTest.class,
      getCatalog());
  testData.addStyle(HUMANS, "humans.sld", ResourcePoolTest.class, getCatalog());
  testData.addStyle(EXTERNAL_ENTITIES, "externalEntities.sld", TestData.class, getCatalog());
  StyleInfo style = getCatalog().getStyleByName("relative");
  style.setFormatVersion(new Version("1.1.0"));
  getCatalog().save(style);
  style = getCatalog().getStyleByName(HUMANS);
  style.setFormatVersion(new Version("1.1.0"));
  getCatalog().save(style);
  File images = new File(testData.getDataDirectoryRoot(), "styles/images");
  assertTrue(images.mkdir());
  File image = new File("./src/test/resources/org/geoserver/catalog/rockFillSymbol.png");
  assertTrue(image.exists());
  FileUtils.copyFileToDirectory(image, images);
  rockFillSymbolFile = new File(images, image.getName()).getCanonicalFile();
  testData.addRasterLayer(
      TIMERANGES, "timeranges.zip", null, null, SystemTestData.class, getCatalog());
  FileUtils.copyFileToDirectory(
      new File("./src/test/resources/geoserver-environment.properties"),
      testData.getDataDirectoryRoot());
}

代码示例来源:origin: geoserver/geoserver

style.setFormatVersion(new Version("1.1.0"));
catalog.save(style);
File images = new File(testData.getDataDirectoryRoot(), "styles/images");

相关文章