Package org.apache.ivy.plugins.parser
Class AbstractModuleDescriptorParser.AbstractParser
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser.AbstractParser
-
- All Implemented Interfaces:
org.xml.sax.ContentHandler
,org.xml.sax.DTDHandler
,org.xml.sax.EntityResolver
,org.xml.sax.ErrorHandler
- Direct Known Subclasses:
XmlModuleDescriptorParser.Parser
- Enclosing class:
- AbstractModuleDescriptorParser
protected abstract static class AbstractModuleDescriptorParser.AbstractParser extends org.xml.sax.helpers.DefaultHandler
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
DEFAULT_CONF_MAPPING
private java.lang.String
defaultConf
private java.lang.String
defaultConfMapping
private DefaultDependencyDescriptor
defaultConfMappingDescriptor
private java.util.List<java.lang.String>
errors
private DefaultModuleDescriptor
md
private ModuleDescriptorParser
parser
private Resource
res
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractParser(ModuleDescriptorParser parser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addError(java.lang.String msg)
private void
addExtendingConfigurations(java.lang.String[] confs, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperand)
private void
addExtendingConfigurations(java.lang.String conf, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperand)
protected void
checkErrors()
void
error(org.xml.sax.SAXParseException ex)
private java.lang.String
evaluateCondition(java.lang.String conf, DefaultDependencyDescriptor dd)
Evaluate the optional condition in the given configuration, like "[org=MYORG]confX".void
fatalError(org.xml.sax.SAXParseException ex)
protected java.lang.String
getDefaultConf()
protected java.lang.String
getDefaultConfMapping()
protected DependencyDescriptor
getDefaultConfMappingDescriptor()
protected java.util.Date
getDefaultPubDate()
private java.lang.String
getLocationString(org.xml.sax.SAXParseException ex)
Returns a string of the location.protected DefaultModuleDescriptor
getMd()
ModuleDescriptor
getModuleDescriptor()
ModuleDescriptorParser
getModuleDescriptorParser()
protected Resource
getResource()
protected void
parseDepsConfs(java.lang.String[] conf, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperand)
protected void
parseDepsConfs(java.lang.String[] confs, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperand, boolean evaluateConditions)
protected void
parseDepsConfs(java.lang.String confs, DefaultDependencyDescriptor dd)
protected void
parseDepsConfs(java.lang.String confs, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperand)
protected void
parseDepsConfs(java.lang.String confs, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperand, boolean evaluateConditions)
private void
replaceConfigurationWildcards(ModuleDescriptor md)
protected void
setDefaultConf(java.lang.String defaultConf)
protected void
setDefaultConfMapping(java.lang.String defaultConf)
protected void
setMd(DefaultModuleDescriptor md)
void
setResource(Resource res)
void
warning(org.xml.sax.SAXParseException ex)
-
-
-
Field Detail
-
DEFAULT_CONF_MAPPING
private static final java.lang.String DEFAULT_CONF_MAPPING
- See Also:
- Constant Field Values
-
defaultConf
private java.lang.String defaultConf
-
defaultConfMapping
private java.lang.String defaultConfMapping
-
defaultConfMappingDescriptor
private DefaultDependencyDescriptor defaultConfMappingDescriptor
-
res
private Resource res
-
errors
private java.util.List<java.lang.String> errors
-
md
private DefaultModuleDescriptor md
-
parser
private ModuleDescriptorParser parser
-
-
Constructor Detail
-
AbstractParser
protected AbstractParser(ModuleDescriptorParser parser)
-
-
Method Detail
-
getModuleDescriptorParser
public ModuleDescriptorParser getModuleDescriptorParser()
-
checkErrors
protected void checkErrors() throws java.text.ParseException
- Throws:
java.text.ParseException
-
setResource
public void setResource(Resource res)
-
getResource
protected Resource getResource()
-
getDefaultConfMapping
protected java.lang.String getDefaultConfMapping()
-
setDefaultConfMapping
protected void setDefaultConfMapping(java.lang.String defaultConf)
-
parseDepsConfs
protected void parseDepsConfs(java.lang.String confs, DefaultDependencyDescriptor dd)
-
parseDepsConfs
protected void parseDepsConfs(java.lang.String confs, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperand)
-
parseDepsConfs
protected void parseDepsConfs(java.lang.String confs, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperand, boolean evaluateConditions)
-
parseDepsConfs
protected void parseDepsConfs(java.lang.String[] conf, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperand)
-
parseDepsConfs
protected void parseDepsConfs(java.lang.String[] confs, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperand, boolean evaluateConditions)
-
evaluateCondition
private java.lang.String evaluateCondition(java.lang.String conf, DefaultDependencyDescriptor dd)
Evaluate the optional condition in the given configuration, like "[org=MYORG]confX". If the condition evaluates to true, the configuration is returned, if the condition evaluates to false, null is returned. If there are no conditions, the configuration itself is returned.- Parameters:
conf
- the configuration to evaluatedd
- the dependency descriptor to which the configuration will be added- Returns:
- the evaluated condition
-
addExtendingConfigurations
private void addExtendingConfigurations(java.lang.String[] confs, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperand)
-
addExtendingConfigurations
private void addExtendingConfigurations(java.lang.String conf, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperand)
-
getDefaultConfMappingDescriptor
protected DependencyDescriptor getDefaultConfMappingDescriptor()
-
addError
protected void addError(java.lang.String msg)
-
warning
public void warning(org.xml.sax.SAXParseException ex)
- Specified by:
warning
in interfaceorg.xml.sax.ErrorHandler
- Overrides:
warning
in classorg.xml.sax.helpers.DefaultHandler
-
error
public void error(org.xml.sax.SAXParseException ex)
- Specified by:
error
in interfaceorg.xml.sax.ErrorHandler
- Overrides:
error
in classorg.xml.sax.helpers.DefaultHandler
-
fatalError
public void fatalError(org.xml.sax.SAXParseException ex) throws org.xml.sax.SAXException
- Specified by:
fatalError
in interfaceorg.xml.sax.ErrorHandler
- Overrides:
fatalError
in classorg.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
-
getLocationString
private java.lang.String getLocationString(org.xml.sax.SAXParseException ex)
Returns a string of the location.
-
getDefaultConf
protected java.lang.String getDefaultConf()
-
setDefaultConf
protected void setDefaultConf(java.lang.String defaultConf)
-
getModuleDescriptor
public ModuleDescriptor getModuleDescriptor() throws java.text.ParseException
- Throws:
java.text.ParseException
-
getDefaultPubDate
protected java.util.Date getDefaultPubDate()
-
replaceConfigurationWildcards
private void replaceConfigurationWildcards(ModuleDescriptor md)
-
setMd
protected void setMd(DefaultModuleDescriptor md)
-
getMd
protected DefaultModuleDescriptor getMd()
-
-