Java 类org.springframework.boot.configurationprocessor.metadata.JsonMarshaller 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:TestConfigurationMetadataAnnotationProcessor.java   
@Override
protected ConfigurationMetadata writeMetaData() {
    super.writeMetaData();
    try {
        File metadataFile = new File(this.outputLocation,
                "META-INF/spring-configuration-metadata.json");
        if (metadataFile.isFile()) {
            this.metadata = new JsonMarshaller()
                    .read(new FileInputStream(metadataFile));
        }
        else {
            this.metadata = new ConfigurationMetadata();
        }
        return this.metadata;
    }
    catch (IOException e) {
        throw new RuntimeException("Failed to read metadata from disk", e);
    }
}
项目:spring-boot-concourse    文件:TestConfigurationMetadataAnnotationProcessor.java   
@Override
protected ConfigurationMetadata writeMetaData() {
    super.writeMetaData();
    try {
        File metadataFile = new File(this.outputLocation,
                "META-INF/spring-configuration-metadata.json");
        if (metadataFile.isFile()) {
            this.metadata = new JsonMarshaller()
                    .read(new FileInputStream(metadataFile));
        }
        else {
            this.metadata = new ConfigurationMetadata();
        }
        return this.metadata;
    }
    catch (IOException e) {
        throw new RuntimeException("Failed to read metadata from disk", e);
    }
}
项目:contestparser    文件:TestConfigurationMetadataAnnotationProcessor.java   
@Override
protected ConfigurationMetadata writeMetaData() {
    super.writeMetaData();
    try {
        File metadataFile = new File(this.outputLocation,
                "META-INF/spring-configuration-metadata.json");
        if (metadataFile.isFile()) {
            this.metadata = new JsonMarshaller()
                    .read(new FileInputStream(metadataFile));
        }
        else {
            this.metadata = new ConfigurationMetadata();
        }
        return this.metadata;
    }
    catch (IOException e) {
        throw new RuntimeException("Failed to read metadata from disk", e);
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MetadataStore.java   
public void writeMetadata(ConfigurationMetadata metadata) throws IOException {
    if (!metadata.getItems().isEmpty()) {
        OutputStream outputStream = createMetadataResource().openOutputStream();
        try {
            new JsonMarshaller().write(metadata, outputStream);
        }
        finally {
            outputStream.close();
        }
    }
}
项目:spring-boot-concourse    文件:MetadataStore.java   
public void writeMetadata(ConfigurationMetadata metadata) throws IOException {
    if (!metadata.getItems().isEmpty()) {
        OutputStream outputStream = createMetadataResource().openOutputStream();
        try {
            new JsonMarshaller().write(metadata, outputStream);
        }
        finally {
            outputStream.close();
        }
    }
}
项目:contestparser    文件:MetadataStore.java   
public void writeMetadata(ConfigurationMetadata metadata) throws IOException {
    if (!metadata.getItems().isEmpty()) {
        OutputStream outputStream = createMetadataResource().openOutputStream();
        try {
            new JsonMarshaller().write(metadata, outputStream);
        }
        finally {
            outputStream.close();
        }
    }
}