├── .asf.yaml
├── .gitattributes
├── .github
├── GH-ROBOTS.txt
├── dependabot.yml
├── pull_request_template.md
└── workflows
│ ├── codeql-analysis.yml
│ ├── dependency-review.yml
│ ├── maven.yml
│ └── scorecards-analysis.yml
├── .gitignore
├── .pmd
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE.txt
├── NOTICE.txt
├── PROPOSAL.html
├── README.md
├── RELEASE-NOTES.txt
├── SECURITY.md
├── commons-digester3-core
├── checkstyle-suppressions.xml
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── org
│ │ │ └── apache
│ │ │ └── commons
│ │ │ └── digester3
│ │ │ ├── AbstractMethodRule.java
│ │ │ ├── AbstractObjectCreationFactory.java
│ │ │ ├── AbstractRulesImpl.java
│ │ │ ├── BeanPropertySetterRule.java
│ │ │ ├── CallMethodRule.java
│ │ │ ├── CallParamRule.java
│ │ │ ├── DefaultThrowingErrorHandler.java
│ │ │ ├── Digester.java
│ │ │ ├── ExtendedBaseRules.java
│ │ │ ├── FactoryCreateRule.java
│ │ │ ├── NodeCreateRule.java
│ │ │ ├── ObjectCreateRule.java
│ │ │ ├── ObjectCreationFactory.java
│ │ │ ├── ObjectParamRule.java
│ │ │ ├── PathCallParamRule.java
│ │ │ ├── PatternRuleMatcher.java
│ │ │ ├── RecordedInvocation.java
│ │ │ ├── RegexMatcher.java
│ │ │ ├── RegexRules.java
│ │ │ ├── Rule.java
│ │ │ ├── RuleMatcher.java
│ │ │ ├── RuleSet.java
│ │ │ ├── RuleSetBase.java
│ │ │ ├── Rules.java
│ │ │ ├── RulesBase.java
│ │ │ ├── SetNestedPropertiesRule.java
│ │ │ ├── SetNextRule.java
│ │ │ ├── SetPropertiesRule.java
│ │ │ ├── SetPropertyRule.java
│ │ │ ├── SetRootRule.java
│ │ │ ├── SetTopRule.java
│ │ │ ├── SimpleRegexMatcher.java
│ │ │ ├── StackAction.java
│ │ │ ├── Substitutor.java
│ │ │ ├── WithDefaultsRulesWrapper.java
│ │ │ ├── annotations
│ │ │ ├── AnnotationHandler.java
│ │ │ ├── AnnotationHandlerFactory.java
│ │ │ ├── DefaultAnnotationHandlerFactory.java
│ │ │ ├── DigesterRule.java
│ │ │ ├── DigesterRuleList.java
│ │ │ ├── FromAnnotationsRuleModule.java
│ │ │ ├── WithMemoryRulesBinder.java
│ │ │ ├── handlers
│ │ │ │ ├── AbstractMethodHandler.java
│ │ │ │ ├── BeanPropertySetterHandler.java
│ │ │ │ ├── CallMethodHandler.java
│ │ │ │ ├── CallParamHandler.java
│ │ │ │ ├── FactoryCreateHandler.java
│ │ │ │ ├── ObjectCreateHandler.java
│ │ │ │ ├── PathCallParamHandler.java
│ │ │ │ ├── SetNextHandler.java
│ │ │ │ ├── SetPropertiesHandler.java
│ │ │ │ ├── SetRootHandler.java
│ │ │ │ ├── SetTopHandler.java
│ │ │ │ └── package-info.java
│ │ │ ├── package-info.java
│ │ │ ├── reflect
│ │ │ │ ├── MethodArgument.java
│ │ │ │ └── package-info.java
│ │ │ ├── rules
│ │ │ │ ├── BeanPropertySetter.java
│ │ │ │ ├── CallMethod.java
│ │ │ │ ├── CallParam.java
│ │ │ │ ├── CreationRule.java
│ │ │ │ ├── FactoryCreate.java
│ │ │ │ ├── ObjectCreate.java
│ │ │ │ ├── PathCallParam.java
│ │ │ │ ├── SetNext.java
│ │ │ │ ├── SetProperty.java
│ │ │ │ ├── SetRoot.java
│ │ │ │ ├── SetTop.java
│ │ │ │ └── package-info.java
│ │ │ └── utils
│ │ │ │ ├── AnnotationUtils.java
│ │ │ │ └── package-info.java
│ │ │ ├── binder
│ │ │ ├── AbstractBackToLinkedRuleBuilder.java
│ │ │ ├── AbstractNamespaceURIBasedRulesModule.java
│ │ │ ├── AbstractParamTypeBuilder.java
│ │ │ ├── AbstractRulesModule.java
│ │ │ ├── AddAliasBuilder.java
│ │ │ ├── BeanPropertySetterBuilder.java
│ │ │ ├── BinderClassLoader.java
│ │ │ ├── ByRuleBuilder.java
│ │ │ ├── ByRuleProviderBuilder.java
│ │ │ ├── CallMethodBuilder.java
│ │ │ ├── CallParamBuilder.java
│ │ │ ├── DefaultRulesBinder.java
│ │ │ ├── DigesterLoader.java
│ │ │ ├── DigesterLoadingException.java
│ │ │ ├── ErrorMessage.java
│ │ │ ├── FactoryCreateBuilder.java
│ │ │ ├── FromBinderRuleSet.java
│ │ │ ├── LinkedRuleBuilder.java
│ │ │ ├── NestedPropertiesBuilder.java
│ │ │ ├── NodeCreateRuleProvider.java
│ │ │ ├── ObjectCreateBuilder.java
│ │ │ ├── ObjectParamBuilder.java
│ │ │ ├── PathCallParamBuilder.java
│ │ │ ├── PluginCreateRuleBuilder.java
│ │ │ ├── PluginDeclarationRuleBuilder.java
│ │ │ ├── RuleProvider.java
│ │ │ ├── RulesBinder.java
│ │ │ ├── RulesModule.java
│ │ │ ├── SetNextBuilder.java
│ │ │ ├── SetPropertiesBuilder.java
│ │ │ ├── SetPropertyBuilder.java
│ │ │ ├── SetRootBuilder.java
│ │ │ ├── SetTopBuilder.java
│ │ │ └── package-info.java
│ │ │ ├── package-info.java
│ │ │ ├── plugins
│ │ │ ├── Declaration.java
│ │ │ ├── InitializableRule.java
│ │ │ ├── LogUtils.java
│ │ │ ├── PluginAssertionFailure.java
│ │ │ ├── PluginConfigurationException.java
│ │ │ ├── PluginContext.java
│ │ │ ├── PluginCreateRule.java
│ │ │ ├── PluginDeclarationRule.java
│ │ │ ├── PluginException.java
│ │ │ ├── PluginInvalidInputException.java
│ │ │ ├── PluginManager.java
│ │ │ ├── PluginRules.java
│ │ │ ├── RuleFinder.java
│ │ │ ├── RuleLoader.java
│ │ │ ├── RulesFactory.java
│ │ │ ├── package-info.java
│ │ │ └── strategies
│ │ │ │ ├── FinderFromClass.java
│ │ │ │ ├── FinderFromDfltClass.java
│ │ │ │ ├── FinderFromDfltMethod.java
│ │ │ │ ├── FinderFromDfltResource.java
│ │ │ │ ├── FinderFromFile.java
│ │ │ │ ├── FinderFromMethod.java
│ │ │ │ ├── FinderFromResource.java
│ │ │ │ ├── FinderSetProperties.java
│ │ │ │ ├── LoaderFromClass.java
│ │ │ │ ├── LoaderFromStream.java
│ │ │ │ ├── LoaderSetProperties.java
│ │ │ │ └── package-info.java
│ │ │ ├── substitution
│ │ │ ├── CompoundSubstitutor.java
│ │ │ ├── MultiVariableExpander.java
│ │ │ ├── VariableAttributes.java
│ │ │ ├── VariableExpander.java
│ │ │ ├── VariableSubstitutor.java
│ │ │ └── package-info.java
│ │ │ └── xmlrules
│ │ │ ├── AbstractXmlMethodRule.java
│ │ │ ├── AbstractXmlRule.java
│ │ │ ├── BeanPropertySetterRule.java
│ │ │ ├── CallMethodRule.java
│ │ │ ├── CallParamRule.java
│ │ │ ├── FactoryCreateRule.java
│ │ │ ├── FromXmlRulesModule.java
│ │ │ ├── IncludeRule.java
│ │ │ ├── NameSpaceURIRulesBinder.java
│ │ │ ├── NodeCreateRule.java
│ │ │ ├── ObjectCreateRule.java
│ │ │ ├── ObjectParamRule.java
│ │ │ ├── PatternRule.java
│ │ │ ├── PatternStack.java
│ │ │ ├── PrefixedRulesBinder.java
│ │ │ ├── SetNamespaceURIRule.java
│ │ │ ├── SetNestedPropertiesAliasRule.java
│ │ │ ├── SetNestedPropertiesIgnoreRule.java
│ │ │ ├── SetNestedPropertiesRule.java
│ │ │ ├── SetNextRule.java
│ │ │ ├── SetPropertiesAliasRule.java
│ │ │ ├── SetPropertiesIgnoreRule.java
│ │ │ ├── SetPropertiesRule.java
│ │ │ ├── SetPropertyRule.java
│ │ │ ├── SetRootRule.java
│ │ │ ├── SetTopRule.java
│ │ │ ├── WithMemoryRulesBinder.java
│ │ │ ├── XmlRulesModule.java
│ │ │ └── package-info.java
│ └── resources
│ │ ├── org
│ │ └── apache
│ │ │ └── commons
│ │ │ └── digester3
│ │ │ └── xmlrules
│ │ │ └── digester-rules.dtd
│ │ └── overview.html
│ └── test
│ ├── java
│ └── org
│ │ └── apache
│ │ └── commons
│ │ └── digester3
│ │ ├── Address.java
│ │ ├── AlphaBean.java
│ │ ├── AsyncReaderTestCase.java
│ │ ├── BeanPropertySetterRuleTestCase.java
│ │ ├── BetaBean.java
│ │ ├── Box.java
│ │ ├── CallMethodRuleTestCase.java
│ │ ├── DTDValidationTestCase.java
│ │ ├── Digester133TestCase.java
│ │ ├── Digester153TestCase.java
│ │ ├── Digester162TestCase.java
│ │ ├── Digester171TestCase.java
│ │ ├── DigesterTestCase.java
│ │ ├── Employee.java
│ │ ├── ErrorHandlerTest.java
│ │ ├── ExtendedBaseRulesTestCase.java
│ │ ├── LocationTrackerTestCase.java
│ │ ├── Nameable.java
│ │ ├── NamedBean.java
│ │ ├── NamespaceSnapshotTestCase.java
│ │ ├── NamespacedBox.java
│ │ ├── NodeCreateRuleTestCase.java
│ │ ├── ObjectCreationFactoryTestImpl.java
│ │ ├── ObjectParamRuleTestCase.java
│ │ ├── OtherTestObjectCreationFactory.java
│ │ ├── OverlappingCallMethodRuleTestCase.java
│ │ ├── ParamBean.java
│ │ ├── PrimitiveBean.java
│ │ ├── RegexRulesTestCase.java
│ │ ├── RuleTestCase.java
│ │ ├── RulesBaseTestCase.java
│ │ ├── SetNestedPropertiesRuleTestCase.java
│ │ ├── SetPropertiesRuleTestCase.java
│ │ ├── SetPropertyRuleTestCase.java
│ │ ├── SimpleTestBean.java
│ │ ├── TestBean.java
│ │ ├── TestEntityResolution.java
│ │ ├── TestFactoryCreate.java
│ │ ├── TestRule.java
│ │ ├── TestRuleSet.java
│ │ ├── URLTestCase.java
│ │ ├── WithDefaultsRulesWrapperTestCase.java
│ │ ├── XIncludeTestCase.java
│ │ ├── XMLSchemaTestCase.java
│ │ ├── annotations
│ │ ├── AbstractAnnotatedPojoTestCase.java
│ │ ├── addressbook
│ │ │ ├── Address.java
│ │ │ ├── AddressBook.java
│ │ │ ├── AddressBookTestCase.java
│ │ │ └── Person.java
│ │ ├── catalog
│ │ │ ├── AudioVisual.java
│ │ │ ├── Book.java
│ │ │ ├── BookFactory.java
│ │ │ ├── Catalog.java
│ │ │ ├── CatalogTestCase.java
│ │ │ └── Item.java
│ │ ├── employee
│ │ │ ├── Address.java
│ │ │ ├── Employee.java
│ │ │ └── EmployeeTestCase.java
│ │ ├── failingtests
│ │ │ ├── BeanWithFakeHandler.java
│ │ │ ├── FailingDigesterLoaderHandlerFactory.java
│ │ │ ├── FailingTestCase.java
│ │ │ ├── FakeHandler.java
│ │ │ └── FakeRule.java
│ │ ├── person
│ │ │ ├── Person.java
│ │ │ └── PersonTestCase.java
│ │ ├── rss
│ │ │ ├── Channel.java
│ │ │ ├── Image.java
│ │ │ ├── Item.java
│ │ │ └── RssTestCase.java
│ │ └── servletbean
│ │ │ ├── ServletBean.java
│ │ │ └── ServletBeanTestCase.java
│ │ ├── binder
│ │ ├── BinderClassLoaderTestCase.java
│ │ ├── Digester163TestCase.java
│ │ ├── DigesterLoaderTestCase.java
│ │ └── Entity.java
│ │ ├── plugins
│ │ ├── Container.java
│ │ ├── ContainerCustomRules.java
│ │ ├── DumperRule.java
│ │ ├── ObjectTestImpl.java
│ │ ├── Slider.java
│ │ ├── TestConfigurablePluginAttributes.java
│ │ ├── TestDeclaration.java
│ │ ├── TestDefaultPlugin.java
│ │ ├── TestDelegate.java
│ │ ├── TestInline.java
│ │ ├── TestLocalRules.java
│ │ ├── TestRecursion.java
│ │ ├── TestRuleInfo.java
│ │ ├── TestXmlRuleInfo.java
│ │ ├── TextLabel.java
│ │ ├── TextLabel2.java
│ │ ├── TextLabel2RuleInfo.java
│ │ ├── Utils.java
│ │ └── Widget.java
│ │ ├── substitution
│ │ ├── CompoundSubstitutorTestCase.java
│ │ └── VariableExpansionTestCase.java
│ │ └── xmlrules
│ │ ├── BeanPropertySetterRuleTestCase.java
│ │ ├── CallParamTestObject.java
│ │ ├── DigesterPatternStackTest.java
│ │ ├── DigesterRulesSourceTestImpl.java
│ │ ├── Entry.java
│ │ ├── Feed.java
│ │ ├── FromXmlRuleSetTest.java
│ │ ├── IncludeTest.java
│ │ ├── ObjectTestImpl.java
│ │ ├── SetNamespaceURITestCase.java
│ │ └── ThrowExceptionCreationFactory.java
│ └── resources
│ └── org
│ └── apache
│ └── commons
│ └── digester3
│ ├── AttributeDefinedConstructor.xml
│ ├── BasicConstructor.xml
│ ├── ConstructorWithAttributeAndElement.xml
│ ├── Test-digester-172-wrong.xml
│ ├── Test1.xml
│ ├── Test10.xml
│ ├── Test11.xml
│ ├── Test12-01.xml
│ ├── Test12-02.xml
│ ├── Test12.xml
│ ├── Test13-01.xml
│ ├── Test13-02.xml
│ ├── Test13.xsd
│ ├── Test2.xml
│ ├── Test3.xml
│ ├── Test4.xml
│ ├── Test5.xml
│ ├── Test6.xml
│ ├── Test7.xml
│ ├── Test8.xml
│ ├── Test9.xml
│ ├── annotations
│ ├── addressbook
│ │ └── AddressBook.xml
│ ├── catalog
│ │ └── Catalog.xml
│ ├── employee
│ │ └── Employee.xml
│ ├── person
│ │ └── Person.xml
│ ├── rss
│ │ └── Channel.xml
│ └── servletbean
│ │ └── ServletBean.xml
│ ├── binder
│ ├── rules.xml
│ └── test.xml
│ ├── digester-162.xml
│ ├── document-with-relative-dtd-error.xml
│ ├── document-with-relative-dtd.xml
│ ├── extractPropertyNameFromAttribute.xml
│ ├── plugins
│ ├── ObjectTestImplRuleInfo.xml
│ ├── test1.xml
│ ├── test2.xml
│ ├── test3.xml
│ ├── test4a.xml
│ ├── test4b.xml
│ ├── test5a.xml
│ ├── test5b.xml
│ ├── test5c.xml
│ ├── test6.xml
│ ├── test7.xml
│ ├── xmlrules1.xml
│ └── xmlrules2.xml
│ ├── simple.dtd
│ └── xmlrules
│ ├── atom-content.xml
│ ├── atom-rules.xml
│ ├── constructor-testrules.xml
│ ├── extractPropertyNameFromAttribute-rules.xml
│ ├── test-call-param-rules.xml
│ ├── test-node-create-rules-input.xml
│ ├── test-node-create-rules.xml
│ ├── test.xml
│ ├── testCircularRules.xml
│ ├── testPropertyAliasRules.xml
│ ├── testfactory.xml
│ ├── testfactoryignore.xml
│ ├── testfactorynoignore.xml
│ ├── testrules.xml
│ └── testrulesinclude.xml
├── commons-digester3-dist
├── pom.xml
└── src
│ └── main
│ └── assembly
│ ├── LICENSE-with-deps.txt
│ ├── NOTICE-with-deps.txt
│ ├── bin.xml
│ └── src.xml
├── commons-digester3-examples
├── annotations
│ └── atom
│ │ ├── pom.xml
│ │ ├── readme.txt
│ │ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── commons
│ │ │ └── digester3
│ │ │ └── annotations
│ │ │ └── atom
│ │ │ ├── Entry.java
│ │ │ ├── Feed.java
│ │ │ └── Main.java
│ │ └── xmlcontent.xml
├── api
│ ├── addressbook
│ │ ├── example.xml
│ │ ├── pom.xml
│ │ ├── readme.txt
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── commons
│ │ │ └── digester3
│ │ │ └── examples
│ │ │ └── api
│ │ │ └── addressbook
│ │ │ ├── Address.java
│ │ │ ├── AddressBook.java
│ │ │ ├── Main.java
│ │ │ └── Person.java
│ ├── catalog
│ │ ├── example.xml
│ │ ├── pom.xml
│ │ ├── readme.txt
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── commons
│ │ │ └── digester3
│ │ │ └── examples
│ │ │ └── api
│ │ │ └── catalog
│ │ │ ├── AudioVisual.java
│ │ │ ├── Book.java
│ │ │ ├── BookFactory.java
│ │ │ ├── Catalog.java
│ │ │ ├── Item.java
│ │ │ └── Main.java
│ ├── dbinsert
│ │ ├── example.xml
│ │ ├── pom.xml
│ │ ├── readme.txt
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── commons
│ │ │ └── digester3
│ │ │ └── examples
│ │ │ └── api
│ │ │ └── dbinsert
│ │ │ ├── Main.java
│ │ │ ├── Row.java
│ │ │ ├── RowInserterRule.java
│ │ │ └── Table.java
│ ├── document-markup
│ │ ├── pom.xml
│ │ ├── readme.txt
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── commons
│ │ │ └── digester3
│ │ │ └── examples
│ │ │ └── api
│ │ │ └── documentmarkup
│ │ │ ├── Main.java
│ │ │ ├── MarkupDigester.java
│ │ │ ├── SetTextSegmentRule.java
│ │ │ └── TextSegmentHandler.java
│ └── readme.txt
├── edsl
│ └── atom
│ │ ├── pom.xml
│ │ ├── readme.txt
│ │ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── commons
│ │ │ └── digester3
│ │ │ └── edsl
│ │ │ └── atom
│ │ │ ├── AtomRulesModule.java
│ │ │ ├── Entry.java
│ │ │ ├── Feed.java
│ │ │ └── Main.java
│ │ └── xmlcontent.xml
├── plugins
│ └── pipeline
│ │ ├── compound.xml
│ │ ├── input.txt
│ │ ├── pom.xml
│ │ ├── readme.txt
│ │ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── commons
│ │ │ └── digester3
│ │ │ └── examples
│ │ │ └── plugins
│ │ │ └── pipeline
│ │ │ ├── CaseTransform.java
│ │ │ ├── CompoundTransform.java
│ │ │ ├── Pipeline.java
│ │ │ ├── SubstituteTransform.java
│ │ │ └── Transform.java
│ │ ├── substitute.xml
│ │ └── uppercase.xml
├── pom.xml
├── readme.txt
├── rss
│ ├── LICENSE.txt
│ ├── pom.xml
│ ├── readme.txt
│ └── src
│ │ └── main
│ │ ├── java
│ │ └── org
│ │ │ └── apache
│ │ │ └── commons
│ │ │ └── digester3
│ │ │ └── rss
│ │ │ ├── Channel.java
│ │ │ ├── Image.java
│ │ │ ├── Item.java
│ │ │ ├── RSSDigester.java
│ │ │ └── TextInput.java
│ │ └── resources
│ │ └── org
│ │ └── apache
│ │ └── commons
│ │ └── digester3
│ │ └── rss
│ │ ├── package-info.java
│ │ └── rss-example.xml
└── xmlrules
│ ├── addressbook
│ ├── example.xml
│ ├── pom.xml
│ ├── readme.txt
│ ├── src
│ │ └── main
│ │ │ └── java
│ │ │ └── org
│ │ │ └── apache
│ │ │ └── commons
│ │ │ └── digester3
│ │ │ └── examples
│ │ │ └── xmlrules
│ │ │ └── addressbook
│ │ │ ├── Address.java
│ │ │ ├── AddressBook.java
│ │ │ ├── Main.java
│ │ │ └── Person.java
│ └── xmlrules.xml
│ └── readme.txt
├── pom.xml
└── src
├── changes
└── changes.xml
├── media
└── logo.xcf
└── site
├── fml
└── guide
│ └── faq.fml
├── resources
├── download_digester.cgi
├── dtds
│ ├── digester-rules-3.0.dtd
│ └── digester-rules.dtd
└── images
│ └── logo.png
├── site.xml
└── xdoc
├── download_digester.xml
├── guide
├── annotations.xml
├── async.xml
├── binder.xml
├── constructor.xml
├── core.xml
├── plugins.xml
├── substitution.xml
└── xmlrules.xml
├── index.xml
├── issue-tracking.xml
└── mail-lists.xml
/.asf.yaml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | github:
17 | description: "Apache Commons Digester"
18 | homepage: https://commons.apache.org/digester/
19 |
20 | notifications:
21 | commits: commits@commons.apache.org
22 | issues: issues@commons.apache.org
23 | pullrequests: issues@commons.apache.org
24 | jira_options: link label
25 | jobs: notifications@commons.apache.org
26 | issues_bot_dependabot: notifications@commons.apache.org
27 | pullrequests_bot_dependabot: notifications@commons.apache.org
28 | issues_bot_codecov-commenter: notifications@commons.apache.org
29 | pullrequests_bot_codecov-commenter: notifications@commons.apache.org
30 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | * text=auto
17 |
--------------------------------------------------------------------------------
/.github/GH-ROBOTS.txt:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | # Keeps on creating FUD PRs in test code
17 | # Does not follow Apache disclosure policies
18 | User-agent: JLLeitschuh/security-research
19 | Disallow: *
20 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 | #
8 | # https://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | version: 2
17 | updates:
18 | - package-ecosystem: "maven"
19 | directory: "/"
20 | schedule:
21 | interval: "weekly"
22 | day: "friday"
23 | - package-ecosystem: "github-actions"
24 | directory: "/"
25 | schedule:
26 | interval: "weekly"
27 | day: "friday"
28 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 |
19 |
20 | Thanks for your contribution to [Apache Commons](https://commons.apache.org/)! Your help is appreciated!
21 |
22 | Before you push a pull request, review this list:
23 |
24 | - [ ] Read the [contribution guidelines](CONTRIBUTING.md) for this project.
25 | - [ ] Run a successful build using the default [Maven](https://maven.apache.org/) goal with `mvn`; that's `mvn` on the command line by itself.
26 | - [ ] Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. This may not always be possible but is a best-practice.
27 | - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
28 | - [ ] Each commit in the pull request should have a meaningful subject line and body. Note that commits might be squashed by a maintainer on merge.
29 |
--------------------------------------------------------------------------------
/.github/workflows/dependency-review.yml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # https://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 |
18 | name: 'Dependency Review'
19 | on: [pull_request]
20 |
21 | permissions:
22 | contents: read
23 |
24 | jobs:
25 | dependency-review:
26 | runs-on: ubuntu-latest
27 | steps:
28 | - name: 'Checkout Repository'
29 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30 | - name: 'Dependency Review PR'
31 | uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4.7.1
32 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | **/.classpath
2 | **/.project
3 | **/.settings/
4 | **/bin/
5 | **/target/
6 | **/*.iml
7 | **/.idea/
8 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 |
17 | The Apache code of conduct page is [https://www.apache.org/foundation/policies/conduct.html](https://www.apache.org/foundation/policies/conduct.html).
18 |
--------------------------------------------------------------------------------
/NOTICE.txt:
--------------------------------------------------------------------------------
1 | Apache Commons Digester
2 | Copyright 2001-2025 The Apache Software Foundation
3 |
4 | This product includes software developed at
5 | The Apache Software Foundation (https://www.apache.org/).
6 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 |
17 | The Apache Commons security page is [https://commons.apache.org/security.html](https://commons.apache.org/security.html).
18 |
--------------------------------------------------------------------------------
/commons-digester3-core/checkstyle-suppressions.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/DefaultThrowingErrorHandler.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import org.xml.sax.ErrorHandler;
23 | import org.xml.sax.SAXException;
24 | import org.xml.sax.SAXParseException;
25 |
26 | /**
27 | * @since 3.3
28 | */
29 | public class DefaultThrowingErrorHandler
30 | implements ErrorHandler
31 | {
32 |
33 | @Override
34 | public void error( final SAXParseException e )
35 | throws SAXException
36 | {
37 | throw e;
38 | }
39 |
40 | @Override
41 | public void fatalError( final SAXParseException e )
42 | throws SAXException
43 | {
44 | throw e;
45 | }
46 |
47 | @Override
48 | public void warning( final SAXParseException e )
49 | throws SAXException
50 | {
51 | throw e;
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/RegexMatcher.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | /**
23 | * Regular expression matching strategy for RegexRules.
24 | *
25 | * @since 1.5
26 | */
27 | public abstract class RegexMatcher
28 | {
29 |
30 | /**
31 | * Returns true if the given pattern matches the given path according to the regex algorithm that this strategy
32 | * applies.
33 | *
34 | * @param pathPattern the standard digester path representing the element
35 | * @param rulePattern the regex pattern the path will be tested against
36 | * @return true if the given pattern matches the given path
37 | */
38 | public abstract boolean match( String pathPattern, String rulePattern );
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/RuleMatcher.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import org.xml.sax.Attributes;
23 |
24 | /**
25 | * Defines a functor interface implemented by classes that perform a predicate test
26 | *
27 | * @since 3.0
28 | */
29 | public interface RuleMatcher
30 | {
31 |
32 | /**
33 | * Use the specified parameter to perform a test.
34 | *
35 | * @param namespace the namespace URI of the matching element, or an empty string if the parser is not namespace
36 | * aware or the element has no namespace
37 | * @param pattern Nesting pattern to be matched for this Rule
38 | * @param name the local name if the parser is namespace aware, or just the element name otherwise
39 | * @param attributes The attribute list of this element
40 | * @return true, if the test succeeds, false otherwise
41 | */
42 | boolean match( String namespace, String pattern, String name, Attributes attributes );
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/annotations/AnnotationHandlerFactory.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3.annotations;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import java.lang.annotation.Annotation;
23 | import java.lang.reflect.AnnotatedElement;
24 |
25 | /**
26 | * An object capable of providing instances of {@link AnnotationHandler}.
27 | *
28 | * @since 3.0
29 | */
30 | public interface AnnotationHandlerFactory
31 | {
32 |
33 | /**
34 | * Return an instance of the specified type.
35 | *
36 | * @param The {@link AnnotationHandler} type has to be created
37 | * @param type the class of the object to be returned.
38 | * @return an instance of the specified class.
39 | * @throws Exception if any error occurs while creating the {@link AnnotationHandler} instance.
40 | */
41 | > H newInstance( Class type )
42 | throws Exception;
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/annotations/DefaultAnnotationHandlerFactory.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3.annotations;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import java.lang.annotation.Annotation;
23 | import java.lang.reflect.AnnotatedElement;
24 |
25 | /**
26 | * Default {@link AnnotationHandlerFactory} implementation.
27 | *
28 | * @since 3.0
29 | */
30 | final class DefaultAnnotationHandlerFactory
31 | implements AnnotationHandlerFactory
32 | {
33 |
34 | @Override
35 | public > L newInstance( final Class type )
36 | throws Exception
37 | {
38 | return type.newInstance();
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/annotations/DigesterRuleList.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3.annotations;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import java.lang.annotation.Documented;
23 | import java.lang.annotation.ElementType;
24 | import java.lang.annotation.Retention;
25 | import java.lang.annotation.RetentionPolicy;
26 | import java.lang.annotation.Target;
27 |
28 | /**
29 | * Meta-annotation that marks an annotation as a list of commons-digester annotations.
30 | *
31 | * @since 2.1
32 | */
33 | @Documented
34 | @Target( ElementType.ANNOTATION_TYPE )
35 | @Retention( RetentionPolicy.RUNTIME )
36 | public @interface DigesterRuleList
37 | {
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/annotations/handlers/BeanPropertySetterHandler.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3.annotations.handlers;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import java.lang.reflect.Field;
23 |
24 | import org.apache.commons.digester3.annotations.AnnotationHandler;
25 | import org.apache.commons.digester3.annotations.rules.BeanPropertySetter;
26 | import org.apache.commons.digester3.binder.RulesBinder;
27 |
28 | /**
29 | * {@link BeanPropertySetter} handler.
30 | *
31 | * @since 3.0
32 | */
33 | public final class BeanPropertySetterHandler
34 | implements AnnotationHandler
35 | {
36 |
37 | @Override
38 | public void handle( final BeanPropertySetter annotation, final Field element, final RulesBinder rulesBinder )
39 | {
40 | rulesBinder.forPattern( annotation.pattern() )
41 | .withNamespaceURI( annotation.namespaceURI() )
42 | .setBeanProperty()
43 | .withName( element.getName() );
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/annotations/handlers/SetNextHandler.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3.annotations.handlers;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import java.lang.reflect.Method;
23 |
24 | import org.apache.commons.digester3.annotations.rules.SetNext;
25 | import org.apache.commons.digester3.binder.RulesBinder;
26 |
27 | /**
28 | * {@link SetNext} handler.
29 | *
30 | * @since 3.0
31 | */
32 | public final class SetNextHandler
33 | extends AbstractMethodHandler
34 | {
35 |
36 | @Override
37 | protected void doBind( final String pattern, final String namespaceURI, final Method method, final Class> type, final boolean fireOnBegin,
38 | final RulesBinder rulesBinder )
39 | {
40 | rulesBinder.forPattern( pattern )
41 | .withNamespaceURI( namespaceURI )
42 | .setNext( method.getName() )
43 | .withParameterType( type )
44 | .fireOnBegin( fireOnBegin );
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/annotations/handlers/SetRootHandler.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3.annotations.handlers;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import java.lang.reflect.Method;
23 |
24 | import org.apache.commons.digester3.annotations.rules.SetRoot;
25 | import org.apache.commons.digester3.binder.RulesBinder;
26 |
27 | /**
28 | * {@link SetRoot} handler.
29 | *
30 | * @since 3.0
31 | */
32 | public final class SetRootHandler
33 | extends AbstractMethodHandler
34 | {
35 |
36 | @Override
37 | protected void doBind( final String pattern, final String namespaceURI, final Method method, final Class> type, final boolean fireOnBegin,
38 | final RulesBinder rulesBinder )
39 | {
40 | rulesBinder.forPattern( pattern )
41 | .withNamespaceURI( namespaceURI )
42 | .setRoot( method.getName() )
43 | .withParameterType( type )
44 | .fireOnBegin( fireOnBegin );
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/annotations/handlers/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * The {@code handlers} package contains
22 | * {@link org.apache.commons.digester3.annotations.AnnotationHandler}
23 | * implementations.
24 | */
25 | package org.apache.commons.digester3.annotations.handlers;
26 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/annotations/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * The {@code annotations} package provides annotations based
22 | * rule definitions for {@code Digester}.
23 | */
24 | package org.apache.commons.digester3.annotations;
25 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/annotations/reflect/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * The {@code reflect} package supply missing JVM classes to allow user
22 | * manipulate entities as {@link java.lang.reflect.AnnotatedElement}.
23 | */
24 | package org.apache.commons.digester3.annotations.reflect;
25 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/annotations/rules/CreationRule.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3.annotations.rules;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import java.lang.annotation.Documented;
23 | import java.lang.annotation.ElementType;
24 | import java.lang.annotation.Retention;
25 | import java.lang.annotation.RetentionPolicy;
26 | import java.lang.annotation.Target;
27 |
28 | /**
29 | * Marks a Digester rule as a creation rule, that's crucial for the {@code setNext} rule.
30 | *
31 | * @since 2.1
32 | */
33 | @Documented
34 | @Target( ElementType.ANNOTATION_TYPE )
35 | @Retention( RetentionPolicy.RUNTIME )
36 | public @interface CreationRule
37 | {
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/annotations/rules/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * Classes contained in this package are annotations that reflect Digester rules.
22 | */
23 | package org.apache.commons.digester3.annotations.rules;
24 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/annotations/utils/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * Contains commons utilities classes for Java annotations manipulation.
22 | */
23 | package org.apache.commons.digester3.annotations.utils;
24 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/binder/ByRuleBuilder.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3.binder;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import org.apache.commons.digester3.Rule;
23 |
24 | /**
25 | * Builder chained when invoking {@link LinkedRuleBuilder#addRule(Rule)}.
26 | *
27 | * @param The rule type will be returned by this builder
28 | */
29 | public final class ByRuleBuilder
30 | extends AbstractBackToLinkedRuleBuilder
31 | {
32 |
33 | private final R rule;
34 |
35 | ByRuleBuilder( final String keyPattern, final String namespaceURI, final RulesBinder mainBinder, final LinkedRuleBuilder mainBuilder,
36 | final R rule )
37 | {
38 | super( keyPattern, namespaceURI, mainBinder, mainBuilder );
39 | this.rule = rule;
40 | }
41 |
42 | @Override
43 | protected R createRule()
44 | {
45 | return rule;
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/binder/PluginDeclarationRuleBuilder.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3.binder;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import org.apache.commons.digester3.plugins.PluginDeclarationRule;
23 |
24 | /**
25 | * Builder chained when invoking {@link LinkedRuleBuilder#declarePlugin()}.
26 | *
27 | * @since 3.0
28 | */
29 | public final class PluginDeclarationRuleBuilder
30 | extends AbstractBackToLinkedRuleBuilder
31 | {
32 |
33 | PluginDeclarationRuleBuilder( final String keyPattern, final String namespaceURI, final RulesBinder mainBinder,
34 | final LinkedRuleBuilder mainBuilder )
35 | {
36 | super( keyPattern, namespaceURI, mainBinder, mainBuilder );
37 | }
38 |
39 | @Override
40 | protected PluginDeclarationRule createRule()
41 | {
42 | return new PluginDeclarationRule();
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/binder/RuleProvider.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3.binder;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import org.apache.commons.digester3.Rule;
23 |
24 | /**
25 | * An object capable of providing instances of {@link Rule}.
26 | *
27 | * @param The Rule type created by the provider.
28 | * @since 3.0
29 | */
30 | public interface RuleProvider
31 | {
32 |
33 | /**
34 | * Provides an instance of {@link Rule}. Must never return null.
35 | *
36 | * @return an instance of {@link Rule}.
37 | */
38 | R get();
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/binder/RulesModule.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3.binder;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | /**
23 | * A module is the Digester rule bindings provider.
24 | *
25 | * @since 3.0
26 | */
27 | public interface RulesModule
28 | {
29 |
30 | /**
31 | * Configure the Digester rules binding via the given rules binder.
32 | *
33 | * @param rulesBinder The binder instance used to configure rules bindings.
34 | */
35 | void configure( RulesBinder rulesBinder );
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/binder/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * The Digester EDSL allows configure Digester using fluent APIs.
22 | *
23 | * @since 3.0
24 | */
25 | package org.apache.commons.digester3.binder;
26 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * The {@code xmlrules} package provides for XML-based definition of
22 | * rules for {@code Digester}. This improves maintainability of Java code,
23 | * as rules are now defined in XML and read into {@code Digester}
24 | * at run-time.
25 | */
26 | package org.apache.commons.digester3;
27 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/plugins/InitializableRule.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3.plugins;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | /**
23 | * Defines an interface that a Rule class can implement if it wishes to get an initialization callback after the rule
24 | * has been added to the set of Rules within a PluginRules instance.
25 | *
26 | * @since 1.6
27 | */
28 | public interface InitializableRule
29 | {
30 |
31 | /**
32 | * Called after this Rule object has been added to the list of all Rules. Note that if a single InitializableRule
33 | * instance is associated with more than one pattern, then this method will be called more than once.
34 | *
35 | * @param pattern is the digester match pattern that will trigger this rule.
36 | */
37 | void postRegisterInit( String pattern );
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/plugins/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * The {@code plugins} package provides an easy mechanism whereby new
22 | * digestion rules can be added dynamically during a digestion.
23 | */
24 | package org.apache.commons.digester3.plugins;
25 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/plugins/strategies/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * The {@code plugins.strategies} package contains "rule-finding" strategy
22 | * classes, and their associated "helper" loader classes.
23 | */
24 | package org.apache.commons.digester3.plugins.strategies;
25 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/substitution/VariableExpander.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3.substitution;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | /**
23 | *
24 | * An Interface describing a class capable of expanding strings which may contain variable references. The exact syntax
25 | * of the "reference", and the mechanism for determining the corresponding value to be used is up to the concrete
26 | * implementation.
27 | *
28 | *
29 | * @since 1.6
30 | */
31 | public interface VariableExpander
32 | {
33 |
34 | /**
35 | * Return the input string with any variables replaced by their corresponding value. If there are no variables in
36 | * the string, then the input parameter is returned unaltered.
37 | *
38 | * @param param the string containing variables to be replaced.
39 | * @return the input string with any variables replaced by their corresponding value.
40 | */
41 | String expand( String param );
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/substitution/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * The {@code substitution} provides for manipulation of XML attributes and
22 | * element body text before the data is processed by any Rule objects.
23 | */
24 | package org.apache.commons.digester3.substitution;
25 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/xmlrules/PatternStack.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3.xmlrules;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import java.util.Stack;
23 |
24 | /**
25 | */
26 | final class PatternStack
27 | extends Stack
28 | {
29 |
30 | private static final long serialVersionUID = 1L;
31 |
32 | @Override
33 | public String toString()
34 | {
35 | final StringBuilder strBuilder = new StringBuilder();
36 | for ( String elem : this )
37 | {
38 | if ( !elem.isEmpty() )
39 | {
40 | if ( strBuilder.length() > 0 )
41 | {
42 | strBuilder.append( '/' );
43 | }
44 | strBuilder.append( elem );
45 | }
46 | }
47 | return strBuilder.toString();
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/xmlrules/SetNamespaceURIRule.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3.xmlrules;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import org.apache.commons.digester3.Rule;
23 | import org.xml.sax.Attributes;
24 |
25 | /**
26 | * @since 3.0
27 | */
28 | final class SetNamespaceURIRule
29 | extends Rule
30 | {
31 |
32 | private final NameSpaceURIRulesBinder rulesBinder;
33 |
34 | SetNamespaceURIRule( final NameSpaceURIRulesBinder rulesBinder )
35 | {
36 | this.rulesBinder = rulesBinder;
37 | }
38 |
39 | @Override
40 | public void begin( final String namespace, final String name, final Attributes attributes )
41 | throws Exception
42 | {
43 | rulesBinder.addNamespaceURI( attributes.getValue( "namespaceURI" ) );
44 | }
45 |
46 | @Override
47 | public void end( final String namespace, final String name )
48 | throws Exception
49 | {
50 | rulesBinder.removeNamespaceURI();
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/xmlrules/SetNestedPropertiesAliasRule.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3.xmlrules;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import org.apache.commons.digester3.Rule;
23 | import org.apache.commons.digester3.binder.NestedPropertiesBuilder;
24 | import org.xml.sax.Attributes;
25 |
26 | /**
27 | */
28 | final class SetNestedPropertiesAliasRule
29 | extends Rule
30 | {
31 |
32 | @Override
33 | public void begin( final String namespace, final String name, final Attributes attributes )
34 | throws Exception
35 | {
36 | final String elementName = attributes.getValue( "attr-name" );
37 | final String propertyName = attributes.getValue( "prop-name" );
38 |
39 | final NestedPropertiesBuilder builder = getDigester().peek();
40 | builder.addAlias( elementName ).forProperty( propertyName );
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/xmlrules/SetNestedPropertiesIgnoreRule.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3.xmlrules;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import org.apache.commons.digester3.Rule;
23 | import org.apache.commons.digester3.binder.NestedPropertiesBuilder;
24 | import org.xml.sax.Attributes;
25 |
26 | /**
27 | */
28 | final class SetNestedPropertiesIgnoreRule
29 | extends Rule
30 | {
31 |
32 | @Override
33 | public void begin( final String namespace, final String name, final Attributes attributes )
34 | throws Exception
35 | {
36 | final String elementName = attributes.getValue( "elem-name" );
37 |
38 | final NestedPropertiesBuilder builder = getDigester().peek();
39 | builder.ignoreElement( elementName );
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/xmlrules/SetPropertiesAliasRule.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3.xmlrules;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import org.apache.commons.digester3.Rule;
23 | import org.apache.commons.digester3.binder.SetPropertiesBuilder;
24 | import org.xml.sax.Attributes;
25 |
26 | /**
27 | */
28 | final class SetPropertiesAliasRule
29 | extends Rule
30 | {
31 |
32 | @Override
33 | public void begin( final String namespace, final String name, final Attributes attributes )
34 | throws Exception
35 | {
36 | final String attributeName = attributes.getValue( "attr-name" );
37 | final String propertyName = attributes.getValue( "prop-name" );
38 |
39 | final SetPropertiesBuilder builder = getDigester().peek();
40 | builder.addAlias( attributeName ).forProperty( propertyName );
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/xmlrules/SetPropertiesIgnoreRule.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3.xmlrules;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import org.apache.commons.digester3.Rule;
23 | import org.apache.commons.digester3.binder.SetPropertiesBuilder;
24 | import org.xml.sax.Attributes;
25 |
26 | /**
27 | */
28 | final class SetPropertiesIgnoreRule
29 | extends Rule
30 | {
31 |
32 | @Override
33 | public void begin( final String namespace, final String name, final Attributes attributes )
34 | throws Exception
35 | {
36 | final String attributeName = attributes.getValue( "attr-name" );
37 |
38 | final SetPropertiesBuilder builder = getDigester().peek();
39 | builder.ignoreAttribute( attributeName );
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/xmlrules/SetPropertyRule.java:
--------------------------------------------------------------------------------
1 | package org.apache.commons.digester3.xmlrules;
2 |
3 | /*
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * https://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | import org.apache.commons.digester3.binder.LinkedRuleBuilder;
23 | import org.apache.commons.digester3.binder.RulesBinder;
24 | import org.xml.sax.Attributes;
25 |
26 | /**
27 | */
28 | final class SetPropertyRule
29 | extends AbstractXmlRule
30 | {
31 |
32 | SetPropertyRule( final RulesBinder targetRulesBinder, final PatternStack patternStack )
33 | {
34 | super( targetRulesBinder, patternStack );
35 | }
36 |
37 | @Override
38 | protected void bindRule( final LinkedRuleBuilder linkedRuleBuilder, final Attributes attributes )
39 | throws Exception
40 | {
41 | final String name = attributes.getValue( "name" );
42 | final String value = attributes.getValue( "value" );
43 | linkedRuleBuilder.setProperty( name ).extractingValueFromAttribute( value );
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/java/org/apache/commons/digester3/xmlrules/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one
3 | * or more contributor license agreements. See the NOTICE file
4 | * distributed with this work for additional information
5 | * regarding copyright ownership. The ASF licenses this file
6 | * to you under the Apache License, Version 2.0 (the
7 | * "License"); you may not use this file except in compliance
8 | * with the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing,
13 | * software distributed under the License is distributed on an
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | * KIND, either express or implied. See the License for the
16 | * specific language governing permissions and limitations
17 | * under the License.
18 | */
19 |
20 | /**
21 | * The Digester package lets you configure an XML to Java object mapping module,
22 | * which triggers certain actions called rules whenever a particular pattern of
23 | * nested XML elements is recognized.
24 | */
25 | package org.apache.commons.digester3.xmlrules;
26 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/main/resources/overview.html:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 | Overview Documentation for COMMONS-DIGESTER
21 |
22 |
23 |
The Digester component of the Apache Commons subproject supports
24 | rules-based processing of arbitrary XML documents.
25 |
26 |
See the
27 |
28 | Package Description for the org.apache.commons.digester
29 | package for more information.
30 |
31 |
32 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/test/java/org/apache/commons/digester3/Nameable.java:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Licensed to the Apache Software Foundation (ASF) under one or more
4 | * contributor license agreements. See the NOTICE file distributed with
5 | * this work for additional information regarding copyright ownership.
6 | * The ASF licenses this file to You under the Apache License, Version 2.0
7 | * (the "License"); you may not use this file except in compliance with
8 | * the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.commons.digester3;
20 |
21 | /**
22 | * Interface used for testing.
23 | */
24 | public interface Nameable
25 | {
26 | String getName();
27 |
28 | void setName( String name );
29 | }
30 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/test/java/org/apache/commons/digester3/NamedBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Licensed to the Apache Software Foundation (ASF) under one or more
4 | * contributor license agreements. See the NOTICE file distributed with
5 | * this work for additional information regarding copyright ownership.
6 | * The ASF licenses this file to You under the Apache License, Version 2.0
7 | * (the "License"); you may not use this file except in compliance with
8 | * the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.commons.digester3;
20 |
21 | /**
22 | * Very simple test bean
23 | */
24 | public class NamedBean
25 | {
26 |
27 | private String name = "**UNSET**";
28 |
29 | public NamedBean()
30 | {
31 | }
32 |
33 | public NamedBean( final String name )
34 | {
35 | }
36 |
37 | public String getName()
38 | {
39 | return name;
40 | }
41 |
42 | public void setName( final String name )
43 | {
44 | this.name = name;
45 | }
46 |
47 | public void test( final String name, final String ignored )
48 | {
49 | setName( name );
50 | }
51 |
52 | @Override
53 | public String toString()
54 | {
55 | return "NamedBean[" + getName() + "]";
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/test/java/org/apache/commons/digester3/NamespacedBox.java:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Licensed to the Apache Software Foundation (ASF) under one or more
4 | * contributor license agreements. See the NOTICE file distributed with
5 | * this work for additional information regarding copyright ownership.
6 | * The ASF licenses this file to You under the Apache License, Version 2.0
7 | * (the "License"); you may not use this file except in compliance with
8 | * the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.commons.digester3;
20 |
21 | import java.util.Map;
22 |
23 | /**
24 | * Simple class for use in unit tests. A box with a namespaces property to store the current namespaces as a Map. Used
25 | * by NamespaceSnapshotTestCase.
26 | */
27 | public class NamespacedBox
28 | extends Box
29 | {
30 |
31 | private Map namespaces;
32 |
33 | public NamespacedBox()
34 | {
35 | }
36 |
37 | public Map getNamespaces()
38 | {
39 | return namespaces;
40 | }
41 |
42 | public void setNamespaces( final Map namespaces )
43 | {
44 | this.namespaces = namespaces;
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/commons-digester3-core/src/test/java/org/apache/commons/digester3/ObjectCreationFactoryTestImpl.java:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * Licensed to the Apache Software Foundation (ASF) under one or more
4 | * contributor license agreements. See the NOTICE file distributed with
5 | * this work for additional information regarding copyright ownership.
6 | * The ASF licenses this file to You under the Apache License, Version 2.0
7 | * (the "License"); you may not use this file except in compliance with
8 | * the License. You may obtain a copy of the License at
9 | *
10 | * https://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package org.apache.commons.digester3;
20 |
21 | import org.xml.sax.Attributes;
22 | import org.xml.sax.helpers.AttributesImpl;
23 |
24 | /**
25 | * Object creation factory used for testing.
26 | */
27 |
28 | public class ObjectCreationFactoryTestImpl
29 | extends AbstractObjectCreationFactory