Stylefactory = stylefactory. createstylefactory (); <br/> Style = stylefactory. getdefaultstyle (); <br/> // feature type style 1 <br/> featuretypestyle FTS = stylefactory. createfeaturetypestyle (); <br/> fts. setfeaturetypename ("feature-type-1"); <br/> style. addfeaturetypestyle (FTS); </P> <p> // feature type style 2 <br/> featuretypestyle fts2 = stylefactory. createfeaturetypestyle (); <br/> fts2.setfeaturetypename ("feature-type-2"); <br/> // creating the Rule 1 <br/> rule rule1 = stylefactory. createrule (); <br/> rule1.setname ("rule1"); <br/> filterfactory = filterfactory. createfilterfactory (); <br/> filter afilter = filterfactory. createfidfilter ("FID"); <br/> rule1.setfilter (afilter); <br/> fts2.addrule (rule1 ); <br/> // creating the rule 2 <br/> rule rule2 = stylefactory. createrule (); <br/> rule2.setiselsefilter (true); <br/> rule2.setname ("rule2"); <br/> fts2.addrule (rule2); <br/> style. addfeaturetypestyle (fts2 );