/** * Validates all {@link com.android.manifmerger.XmlElement} attributes belonging to the * {@link com.android.SdkConstants#ANDROID_URI} namespace. * * @param xmlElement xml element to check the attributes from. * @param mergingReport report for errors and warnings. */ private static void validateAndroidAttributes(@NonNull XmlElement xmlElement, @NonNull MergingReport.Builder mergingReport) { for (XmlAttribute xmlAttribute : xmlElement.getAttributes()) { if (xmlAttribute.getModel() != null) { AttributeModel.Validator onWriteValidator = xmlAttribute.getModel() .getOnWriteValidator(); if (onWriteValidator != null) { onWriteValidator.validates( mergingReport, xmlAttribute, xmlAttribute.getValue()); } } } } }
/** * Validate attributes part of the {@link com.android.SdkConstants#ANDROID_URI} * @param mergingReport report to log warnings and errors. * @param xmlElement xml element to check its attributes. */ private static void validateAndroidAttributes(@NonNull MergingReport.Builder mergingReport, @NonNull XmlElement xmlElement) { for (XmlAttribute xmlAttribute : xmlElement.getAttributes()) { AttributeModel model = xmlAttribute.getModel(); if (model != null && model.getOnReadValidator() != null) { model.getOnReadValidator().validates( mergingReport, xmlAttribute, xmlAttribute.getValue()); } } }