private static SegmentConfig createSegment(TypeInfo info, Segment sa, Fields fields) {
        updateTypeInfo(info, sa.type(), sa.collection());
        
        if (info.propertyType == String.class) {
            throw new IllegalArgumentException("type is undefined");
        }
        
        String target = toValue(sa.value());
        
        SegmentConfig sc = new SegmentConfig();
        sc.setName(info.name);
        sc.setLabel(toValue(sa.name()));
        if (target == null) {
            sc.setType(info.propertyName);
        }
        else {
            sc.setTarget(target);
        }
        sc.setCollection(info.collectionName);
        sc.setGetter(toValue(sa.getter()));
        if (sc.getGetter() == null) {
            sc.setGetter(info.getter);
        }
        sc.setSetter(toValue(sa.setter()));
        if (sc.getSetter() == null) {
            sc.setSetter(info.setter);
        }
        sc.setPosition(toValue(sa.at()));
        sc.setUntil(toValue(sa.until()));
        sc.setOrdinal(toValue(sa.ordinal()));
        sc.setMinOccurs(toValue(sa.minOccurs()));
        sc.setMaxOccurs(toUnboundedValue(sa.maxOccurs()));
        sc.setOccursRef(toValue(sa.occursRef()));
        sc.setKey(toValue(sa.key()));
        sc.setLazy(sa.lazy());
        sc.setXmlType(sa.xmlType().toValue());
        sc.setXmlName(toXmlValue(sa.xmlName()));
        sc.setXmlNamespace(toXmlValue(sa.xmlNamespace()));
        sc.setXmlPrefix(toXmlValue(sa.xmlPrefix()));
        sc.setNillable(sa.nillable());
        
        if (sc.getName() == null) {
            throw new IllegalArgumentException("name is undefined");
        }
        
        if (fields != null) {
            for (Field field : fields.value()) {
                sc.add(createField(null, field));
            }
        }
        fields = info.propertyType.getAnnotation(Fields.class);
        if (fields != null) {
            for (Field field : fields.value()) {
                sc.add(createField(null, field));
            }
        }
        
        handleConstructor(sc, info.propertyType);
        addAllChildren(sc, info.propertyType);
        
        return sc;
    }