Package ru.aristar.jnuget

Examples of ru.aristar.jnuget.StringListTypeAdapter


     */
    private Element createMicrosoftElement(String name, boolean nullable, List<String> value) throws ParserConfigurationException {
        String stringValue = null;
        if (value != null) {
            try {
                StringListTypeAdapter adapter = new StringListTypeAdapter();
                stringValue = adapter.marshal(value);
            } catch (Exception e) {
                throw new ParserConfigurationException("Ошибка преобразования списка строк");
            }
        }
        Element element = createMicrosoftElement(name, nullable, MicrosoftTypes.DateTime, stringValue);
View Full Code Here


    public void setProperties(List<Element> properties) throws Exception {
        HashMap<String, Element> hashMap = new HashMap<>();
        for (Element element : properties) {
            hashMap.put(element.getLocalName(), element);
        }
        StringListTypeAdapter adapter = new StringListTypeAdapter();

        this.version = Version.parse(hashMap.get("Version").getTextContent());
        this.title = hashMap.get("Title").getTextContent();
        this.iconUrl = hashMap.get("IconUrl").getTextContent();
        this.licenseUrl = hashMap.get("LicenseUrl").getTextContent();
        this.projectUrl = hashMap.get("ProjectUrl").getTextContent();
        this.reportAbuseUrl = hashMap.get("ReportAbuseUrl").getTextContent();
        this.downloadCount = getIntegerContent(hashMap.get("DownloadCount"));
        this.versionDownloadCount = getIntegerContent(hashMap.get("VersionDownloadCount"));
        this.ratingsCount = getIntegerContent(hashMap.get("RatingsCount"));
        this.versionRatingsCount = getIntegerContent(hashMap.get("VersionRatingsCount"));
        this.rating = getDoubleContent(hashMap.get("Rating"));
        this.versionRating = getDoubleContent(hashMap.get("VersionRating"));
        this.requireLicenseAcceptance = getBooleanContent(hashMap.get("RequireLicenseAcceptance"));
        this.description = hashMap.get("Description").getTextContent();
        this.releaseNotes = hashMap.get("ReleaseNotes").getTextContent();
        this.language = hashMap.get("Language").getTextContent();
        this.published = javax.xml.bind.DatatypeConverter.parseDateTime(hashMap.get("Published").getTextContent()).getTime();
        this.price = getDoubleContent(hashMap.get("Price"));
        this.dependencies = hashMap.get("Dependencies").getTextContent();
        this.packageHash = hashMap.get("PackageHash").getTextContent();
        this.packageSize = getLongContent(hashMap.get("PackageSize"));
        this.externalPackageUri = getStringContent(hashMap.get("ExternalPackageUri"));
        this.categories = getStringContent(hashMap.get("Categories"));
        this.copyright = getStringContent(hashMap.get("Copyright"));
        this.packageType = getStringContent(hashMap.get("PackageType"));
        this.tags = adapter.unmarshal(hashMap.get("Tags").getTextContent());
        this.isLatestVersion = getBooleanContent(hashMap.get("IsLatestVersion"));
        this.summary = getStringContent(hashMap.get("Summary"));
    }
View Full Code Here

TOP

Related Classes of ru.aristar.jnuget.StringListTypeAdapter

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.