Package org.dcm4che3.conf.api.generic

Examples of org.dcm4che3.conf.api.generic.ConfigField


            metadata.put("type", "String");
        }

        @Override
        public String read(ReflectiveConfig config, ConfigReader reader, Field field) throws ConfigurationException {
            ConfigField fieldAnno = field.getAnnotation(ConfigField.class);
            return reader.asString(fieldAnno.name(), (fieldAnno.def().equals("N/A") ? null : fieldAnno.def()));
        }
View Full Code Here


            metadata.put("type", "Integer");
        }

        @Override
        public Integer read(ReflectiveConfig config, ConfigReader reader, Field field) throws ConfigurationException {
            ConfigField fieldAnno = field.getAnnotation(ConfigField.class);
            return reader.asInt(fieldAnno.name(), (fieldAnno.def().equals("N/A") ? "0" : fieldAnno.def()));
        }
View Full Code Here

            metadata.put("type", "Boolean");
        }

        @Override
        public Boolean read(ReflectiveConfig config, ConfigReader reader, Field field) throws ConfigurationException {
            ConfigField fieldAnno = field.getAnnotation(ConfigField.class);
            return reader.asBoolean(fieldAnno.name(), (fieldAnno.def().equals("N/A") ? "false" : fieldAnno.def()));
        }
View Full Code Here

            return false;
        }

        @Override
        public Object read(ReflectiveConfig config, ConfigReader reader, Field field) throws ConfigurationException {
            ConfigField fieldAnno = field.getAnnotation(ConfigField.class);

            if (String.class.isAssignableFrom(field.getType().getComponentType()))
                return reader.asStringArray(fieldAnno.name());
            else if (int.class.isAssignableFrom(field.getType().getComponentType()))
                return reader.asIntArray(fieldAnno.name());
            else if (Code.class.isAssignableFrom(field.getType().getComponentType()))
                return reader.asCodeArray(fieldAnno.name());
            else
                return null;
        }
View Full Code Here

        // figure out the class of declared generic parameter
        Class clazz = (Class) ptypes[1];

        Attributes attrs = new BasicAttributes(true);
        ConfigField fieldAnno = field.getAnnotation(ConfigField.class);
        ConfigClass classAnno = (ConfigClass) clazz.getAnnotation(ConfigClass.class);

        if (classAnno != null) {
            attrs.put("objectClass", classAnno.objectClass());
        } else if (!fieldAnno.mapElementObjectClass().equals("")) {
            attrs.put("objectClass", fieldAnno.mapElementObjectClass());
        } else
            throw new ConfigurationException("objectClass for collection element cannot be resolved, key (" + keyName + " - " + keyValue
                    + ")");

        return new LdapConfigIO(attrs, getCollectionElementDn(keyName, keyValue), config);
View Full Code Here

        String codeMeaning = codes.getProperty(codeValue);
        if (codeMeaning == null)
            throw new IllegalArgumentException("undefined code value: "
                        + codeValue);
        int endDesignator = codeValue.indexOf('-');
        Attributes attrs = new Attributes(3);
        attrs.setString(Tag.CodeValue, VR.SH,
                endDesignator >= 0
                    ? codeValue.substring(endDesignator + 1)
                    : codeValue);
        attrs.setString(Tag.CodingSchemeDesignator, VR.SH,
                endDesignator >= 0
                    ? codeValue.substring(0, endDesignator)
                    : "DCM");
        attrs.setString(Tag.CodeMeaning, VR.LO, codeMeaning);
        return attrs;
    }
View Full Code Here

        bulkDataFiles = dis.getBulkDataFiles();
    }

    public void mergeJSON(String fname) throws Exception {
        if (dataset == null)
            dataset = new Attributes();
        JSONReader reader = parseJSON(fname, dataset);
        Attributes fmi2 = reader.getFileMetaInformation();
        if (fmi2 != null)
            fmi = fmi2;
    }
View Full Code Here

            dos.close();
        }
    }

    private Sequence refSOPSeq(String studyIUID, String seriesIUID) {
        Attributes refStudy = getOrAddItem(evidenceSeq, Tag.StudyInstanceUID, studyIUID);
        Sequence refSeriesSeq = refStudy.ensureSequence(Tag.ReferencedSeriesSequence, 10);
        Attributes refSeries = getOrAddItem(refSeriesSeq,Tag.SeriesInstanceUID, seriesIUID);
        return refSeries.ensureSequence(Tag.ReferencedSOPSequence, 100);
    }
View Full Code Here

        if (fmi2 != null)
            fmi = fmi2;
    }

    public static Attributes parseJSON(String fname) throws Exception {
        Attributes attrs = new Attributes();
        parseJSON(fname, attrs);
        return attrs;
    }
View Full Code Here

    private Attributes getOrAddItem(Sequence seq, int tag, String value) {
        for (Attributes item : seq)
            if (value.equals(item.getString(tag)))
                return item;
       
        Attributes item = new Attributes(2);
        item.setString(tag, VR.UI, value);
        seq.add(item);
        return item;
    }
View Full Code Here

TOP

Related Classes of org.dcm4che3.conf.api.generic.ConfigField

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.