private int getMaxLength ( List < XmlSchemaFacet > facets ) { for ( XmlSchemaFacet facet : facets ) { if ( facet instanceof XmlSchemaMaxLengthFacet ) { return Integer . parseInt ( ( String ) ( ( XmlSchemaMaxLengthFacet ) facet ) . getValue ( ) ) ; } } return - 1 ; }
Retrieve the maxLength facet if it exists .