Class JSONFeatures


  • public class JSONFeatures
    extends Object
    • Field Detail

      • PLACEHOLDER_ID

        public static final org.apache.sling.feature.ArtifactId PLACEHOLDER_ID
    • Constructor Detail

      • JSONFeatures

        public JSONFeatures()
    • Method Detail

      • read

        public static String read​(Reader reader,
                                  org.apache.sling.feature.ArtifactId optionalId,
                                  String location)
                           throws IOException
        Read the feature and add the id attribute if missing
        Parameters:
        reader - The reader
        optionalId - The artifact id to use if the id attribute is missing
        location - The location
        Returns:
        The feature as a string
        Throws:
        IOException - If reading fails
      • write

        public static void write​(Writer writer,
                                 org.apache.sling.feature.Feature feature)
                          throws IOException
        Write the feature. If the id is the PLACEHOLDER_ID then the id is not written out
        Parameters:
        writer - The writer
        feature - The feature
        Throws:
        IOException - If anything goes wrong