Package android.databinding.tool
Class LayoutXmlProcessor
- java.lang.Object
-
- android.databinding.tool.LayoutXmlProcessor
-
public class LayoutXmlProcessor extends java.lang.ObjectProcesses the layout XML, stripping the binding attributes and elements and writes the information into an annotated class file for the annotation processor to work with.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceLayoutXmlProcessor.OriginalFileLookupHelper interface that can find the original copy of a resource XML.static classLayoutXmlProcessor.ResourceInputAPI agnostic class to get resource changes incrementally.
-
Constructor Summary
Constructors Constructor Description LayoutXmlProcessor(java.lang.String applicationPackage, JavaFileWriter fileWriter, LayoutXmlProcessor.OriginalFileLookup originalFileLookup, boolean useAndroidX)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.StringexportLayoutNameFromInfoFileName(java.lang.String infoFileName)static java.lang.StringgenerateExportFileName(java.lang.String fileName, java.lang.String dirName)JavaFileWritergetFileWriter()java.lang.StringgetPackage()ResourceBundlegetResourceBundle()used by the studio pluginvoidprocessFileWithNoDataBinding(java.io.File file)Processes a layout file which does not contain data binding constructs.voidprocessRemovedFile(java.io.File input)booleanprocessResources(LayoutXmlProcessor.ResourceInput input, boolean isViewBindingEnabled, boolean isDataBindingEnabled)booleanprocessSingleFile(android.databinding.tool.util.RelativizableFile input, java.io.File output, boolean isViewBindingEnabled, boolean isDataBindingEnabled)static java.lang.StringtoSystemDependentPath(java.lang.String path)voidwriteLayoutInfoFiles(java.io.File xmlOutDir)voidwriteLayoutInfoFiles(java.io.File xmlOutDir, JavaFileWriter writer)
-
-
-
Constructor Detail
-
LayoutXmlProcessor
public LayoutXmlProcessor(java.lang.String applicationPackage, JavaFileWriter fileWriter, LayoutXmlProcessor.OriginalFileLookup originalFileLookup, boolean useAndroidX)
-
-
Method Detail
-
exportLayoutNameFromInfoFileName
public static java.lang.String exportLayoutNameFromInfoFileName(java.lang.String infoFileName)
-
getResourceBundle
public ResourceBundle getResourceBundle()
used by the studio plugin
-
processRemovedFile
public void processRemovedFile(java.io.File input)
-
processFileWithNoDataBinding
public void processFileWithNoDataBinding(@NonNull java.io.File file)Processes a layout file which does not contain data binding constructs.
-
processSingleFile
public boolean processSingleFile(@NonNull android.databinding.tool.util.RelativizableFile input, @NonNull java.io.File output, boolean isViewBindingEnabled, boolean isDataBindingEnabled) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, javax.xml.xpath.XPathExpressionException, java.io.IOException- Throws:
javax.xml.parsers.ParserConfigurationExceptionorg.xml.sax.SAXExceptionjavax.xml.xpath.XPathExpressionExceptionjava.io.IOException
-
processResources
public boolean processResources(LayoutXmlProcessor.ResourceInput input, boolean isViewBindingEnabled, boolean isDataBindingEnabled) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, javax.xml.xpath.XPathExpressionException, java.io.IOException
- Throws:
javax.xml.parsers.ParserConfigurationExceptionorg.xml.sax.SAXExceptionjavax.xml.xpath.XPathExpressionExceptionjava.io.IOException
-
toSystemDependentPath
public static java.lang.String toSystemDependentPath(java.lang.String path)
-
writeLayoutInfoFiles
public void writeLayoutInfoFiles(java.io.File xmlOutDir) throws javax.xml.bind.JAXBException- Throws:
javax.xml.bind.JAXBException
-
getFileWriter
public JavaFileWriter getFileWriter()
-
writeLayoutInfoFiles
public void writeLayoutInfoFiles(java.io.File xmlOutDir, JavaFileWriter writer) throws javax.xml.bind.JAXBException- Throws:
javax.xml.bind.JAXBException
-
generateExportFileName
public static java.lang.String generateExportFileName(java.lang.String fileName, java.lang.String dirName)
-
getPackage
public java.lang.String getPackage()
-
-