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.StringDEFAULT_CONF_MAPPINGprivate java.lang.StringdefaultConfprivate java.lang.StringdefaultConfMappingprivate DefaultDependencyDescriptordefaultConfMappingDescriptorprivate java.util.List<java.lang.String>errorsprivate DefaultModuleDescriptormdprivate ModuleDescriptorParserparserprivate Resourceres
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractParser(ModuleDescriptorParser parser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddError(java.lang.String msg)private voidaddExtendingConfigurations(java.lang.String[] confs, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperand)private voidaddExtendingConfigurations(java.lang.String conf, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperand)protected voidcheckErrors()voiderror(org.xml.sax.SAXParseException ex)private java.lang.StringevaluateCondition(java.lang.String conf, DefaultDependencyDescriptor dd)Evaluate the optional condition in the given configuration, like "[org=MYORG]confX".voidfatalError(org.xml.sax.SAXParseException ex)protected java.lang.StringgetDefaultConf()protected java.lang.StringgetDefaultConfMapping()protected DependencyDescriptorgetDefaultConfMappingDescriptor()protected java.util.DategetDefaultPubDate()private java.lang.StringgetLocationString(org.xml.sax.SAXParseException ex)Returns a string of the location.protected DefaultModuleDescriptorgetMd()ModuleDescriptorgetModuleDescriptor()ModuleDescriptorParsergetModuleDescriptorParser()protected ResourcegetResource()protected voidparseDepsConfs(java.lang.String[] conf, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperand)protected voidparseDepsConfs(java.lang.String[] confs, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperand, boolean evaluateConditions)protected voidparseDepsConfs(java.lang.String confs, DefaultDependencyDescriptor dd)protected voidparseDepsConfs(java.lang.String confs, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperand)protected voidparseDepsConfs(java.lang.String confs, DefaultDependencyDescriptor dd, boolean useDefaultMappingToGuessRightOperand, boolean evaluateConditions)private voidreplaceConfigurationWildcards(ModuleDescriptor md)protected voidsetDefaultConf(java.lang.String defaultConf)protected voidsetDefaultConfMapping(java.lang.String defaultConf)protected voidsetMd(DefaultModuleDescriptor md)voidsetResource(Resource res)voidwarning(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:
warningin interfaceorg.xml.sax.ErrorHandler- Overrides:
warningin classorg.xml.sax.helpers.DefaultHandler
-
error
public void error(org.xml.sax.SAXParseException ex)
- Specified by:
errorin interfaceorg.xml.sax.ErrorHandler- Overrides:
errorin classorg.xml.sax.helpers.DefaultHandler
-
fatalError
public void fatalError(org.xml.sax.SAXParseException ex) throws org.xml.sax.SAXException- Specified by:
fatalErrorin interfaceorg.xml.sax.ErrorHandler- Overrides:
fatalErrorin 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()
-
-