It is a example:

AttributeDescriptor[] typesNew = new AttributeDescriptor[3];


AttributeTypeBuilder atb = new AttributeTypeBuilder();
                atb.setBinding(Point.class);
                atb.setNillable(false);
                atb.setCRS(DefaultGeographicCRS.WGS84);
                atb.setDefaultValue(null);
                atb.setName(JnlpConstantes.ATRIBUTO_JST_FIGURA);
                
                AttributeDescriptor atJts =
atb.buildDescriptor(JnlpConstantes.ATRIBUTO_JST_FIGURA);
                
                atb.setBinding(Double.class);
                atb.setNillable(false);
                atb.setCRS(DefaultGeographicCRS.WGS84);
                atb.setDefaultValue(null);
                atb.setName(JnlpConstantes.ATRIBUTO_IDENTIFICADOR);
                
                AttributeDescriptor atIden =
atb.buildDescriptor(JnlpConstantes.ATRIBUTO_IDENTIFICADOR);
                
                atb.setBinding(Object.class);
                atb.setNillable(false);
                atb.setCRS(DefaultGeographicCRS.WGS84);
                atb.setDefaultValue(null);
                atb.setName(JnlpConstantes.ATRIBUTO_OBJETO_ALMACENADO);
                
                AttributeDescriptor atObj =
atb.buildDescriptor(JnlpConstantes.ATRIBUTO_OBJETO_ALMACENADO);
                
                
                
                typesNew[0] = atJts;
                
                typesNew[1] = atIden;
                
                typesNew[2] = atObj;




SimpleFeatureType pointType = FeatureTypes.newFeatureType(
                                        typesNew, style.getName());


SimpleFeature ptF = SimpleFeatureBuilder.build(pointType,new Object[]
{point,pruebaDTO.getIdentificador(), pruebaDTO},null);


Chao.



ruantong wrote:
> 
>   hi,
>      Traditionally, I use FeatureTypeFactory.newFeatureType(.... ) to
> create a featuretype,but I found the abstract class is deprecated in
> Getools 2.4.5 and 2.5. I  want to use :
>       FeatureTypeFactory.createFeatureType(...), but in new version     
> FeatureTypeFactory is   an interface,
> I want to use BasicFactories.getFeatureTypeFactory() or getTypeFactory(),
> but found they are also deprecated.
>      see: 
> http://javadoc.geotools.fr/2.5-M3/org/geotools/factory/BasicFactories.html#getFeatureTypeFactory()
>      Thus  I wound like to know, which is not deprecated?
>      Thanks a lot.
> 
> 
> vicky
>  
>  
>  
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-create-a-new-feturetype------message-resend-tp19893851p19894536.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to