private void parseAnnotationValues(PropertyAnnotation annotation, String contents) { if(contents==null) return; Matcher matcher = ANNOTATION_VALUE_PARSER.matcher(contents); while(matcher.find()) { annotation.getValues().put(matcher.group(1), matcher.group(2)); } }
/** * extracts the target locale from a property annotation. * @param property * @return */ private Locale extractTargetLocale(Property property) { PropertyAnnotation annotation = property.findAnnotation(PropertyAnnotations.ANNOTATION_LANGUAGE); if(annotation==null) return null; String localeString = annotation.getValues().get(PropertyAnnotations.TARGET_LANGUAGE); if(localeString==null) return null; return (Locale) PropertiesFactory.eINSTANCE.createFromString(PropertiesPackage.Literals.LOCALE, localeString); }