From 22e4b300a59206b7014b87437b513db7fe8e5a3f Mon Sep 17 00:00:00 2001 From: Emanuel Rabina Date: Mon, 22 Jan 2024 17:30:30 +1300 Subject: [PATCH] Gather all extensions into an extensions package --- ...rg.codehaus.groovy.runtime.ExtensionModule | 18 ++--- .../extensions/FragmentExtensions.groovy | 14 ++-- .../extensions/IAttributeExtensions.groovy | 14 ++-- .../ICloseElementTagExtensions.groovy | 14 ++-- .../extensions/IContextExtensions.groovy | 18 ++--- .../extensions/IModelExtensions.groovy | 69 ++++++++++--------- .../IProcessableElementTagExtensions.groovy | 16 ++--- .../IStandaloneElementTagExtensions.groovy | 14 ++-- .../ITemplateEventExtensions.groovy | 2 +- .../extensions/ITextExtensions.groovy | 16 ++--- .../ChildModelIterator.groovy | 12 ++-- .../{extensions => }/EventIterator.groovy | 12 ++-- .../extensions/FragmentExtensionsTests.groovy | 13 ++-- .../extensions/IModelExtensionsTests.groovy | 12 ++-- .../ChildModelIteratorTests.groovy | 15 ++-- .../models/{extensions => }/ModelLevel.thtest | 0 16 files changed, 131 insertions(+), 128 deletions(-) rename thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/{fragments => }/extensions/FragmentExtensions.groovy (96%) rename thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/{models => }/extensions/IAttributeExtensions.groovy (93%) rename thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/{models => }/extensions/ICloseElementTagExtensions.groovy (92%) rename thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/{context => }/extensions/IContextExtensions.groovy (96%) rename thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/{models => }/extensions/IModelExtensions.groovy (97%) rename thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/{models => }/extensions/IProcessableElementTagExtensions.groovy (96%) rename thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/{models => }/extensions/IStandaloneElementTagExtensions.groovy (93%) rename thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/{models => }/extensions/ITemplateEventExtensions.groovy (97%) rename thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/{models => }/extensions/ITextExtensions.groovy (93%) rename thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/{extensions => }/ChildModelIterator.groovy (93%) rename thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/{extensions => }/EventIterator.groovy (92%) rename thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/{fragments => }/extensions/FragmentExtensionsTests.groovy (95%) rename thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/{models => }/extensions/IModelExtensionsTests.groovy (97%) rename thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/models/{extensions => }/ChildModelIteratorTests.groovy (90%) rename thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/models/{extensions => }/ModelLevel.thtest (100%) diff --git a/thymeleaf-layout-dialect/source/META-INF/services/org.codehaus.groovy.runtime.ExtensionModule b/thymeleaf-layout-dialect/source/META-INF/services/org.codehaus.groovy.runtime.ExtensionModule index d14e7e296..8d4c89c6c 100644 --- a/thymeleaf-layout-dialect/source/META-INF/services/org.codehaus.groovy.runtime.ExtensionModule +++ b/thymeleaf-layout-dialect/source/META-INF/services/org.codehaus.groovy.runtime.ExtensionModule @@ -1,11 +1,11 @@ moduleName = thymeleaf-layout-dialect-extensions moduleVersion = ${moduleVersion} -extensionClasses = nz.net.ultraq.thymeleaf.layoutdialect.context.extensions.IContextExtensions,\ - nz.net.ultraq.thymeleaf.layoutdialect.fragments.extensions.FragmentExtensions,\ - nz.net.ultraq.thymeleaf.layoutdialect.models.extensions.IAttributeExtensions,\ - nz.net.ultraq.thymeleaf.layoutdialect.models.extensions.ICloseElementTagExtensions,\ - nz.net.ultraq.thymeleaf.layoutdialect.models.extensions.IModelExtensions,\ - nz.net.ultraq.thymeleaf.layoutdialect.models.extensions.IProcessableElementTagExtensions,\ - nz.net.ultraq.thymeleaf.layoutdialect.models.extensions.IStandaloneElementTagExtensions,\ - nz.net.ultraq.thymeleaf.layoutdialect.models.extensions.ITemplateEventExtensions,\ - nz.net.ultraq.thymeleaf.layoutdialect.models.extensions.ITextExtensions +extensionClasses = nz.net.ultraq.thymeleaf.layoutdialect.extensions.FragmentExtensions,\ + nz.net.ultraq.thymeleaf.layoutdialect.extensions.IAttributeExtensions,\ + nz.net.ultraq.thymeleaf.layoutdialect.extensions.ICloseElementTagExtensions,\ + nz.net.ultraq.thymeleaf.layoutdialect.extensions.IContextExtensions,\ + nz.net.ultraq.thymeleaf.layoutdialect.extensions.IModelExtensions,\ + nz.net.ultraq.thymeleaf.layoutdialect.extensions.IProcessableElementTagExtensions,\ + nz.net.ultraq.thymeleaf.layoutdialect.extensions.IStandaloneElementTagExtensions,\ + nz.net.ultraq.thymeleaf.layoutdialect.extensions.ITemplateEventExtensions,\ + nz.net.ultraq.thymeleaf.layoutdialect.extensions.ITextExtensions diff --git a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/fragments/extensions/FragmentExtensions.groovy b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/FragmentExtensions.groovy similarity index 96% rename from thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/fragments/extensions/FragmentExtensions.groovy rename to thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/FragmentExtensions.groovy index 4da880a78..164a9188b 100644 --- a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/fragments/extensions/FragmentExtensions.groovy +++ b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/FragmentExtensions.groovy @@ -1,12 +1,12 @@ /* * Copyright 2015, Emanuel Rabina (http://www.ultraq.net.nz/) - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -14,7 +14,7 @@ * limitations under the License. */ -package nz.net.ultraq.thymeleaf.layoutdialect.fragments.extensions +package nz.net.ultraq.thymeleaf.layoutdialect.extensions import org.thymeleaf.context.ITemplateContext import org.thymeleaf.model.IModel @@ -22,7 +22,7 @@ import org.thymeleaf.processor.element.IElementModelStructureHandler /** * Extensions to Thymeleaf for working with fragments. - * + * * @author Emanuel Rabina */ class FragmentExtensions { @@ -31,7 +31,7 @@ class FragmentExtensions { /** * Retrieves the fragment collection for the current context. - * + * * @param self * @param fromDecorator * @return A new or existing fragment collection. @@ -55,7 +55,7 @@ class FragmentExtensions { /** * Set a fragment cache to contain any existing fragments, plus the given new * fragments, with the same scope as setting a local variable. - * + * * @param self * @param context * @param fragments diff --git a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/IAttributeExtensions.groovy b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/IAttributeExtensions.groovy similarity index 93% rename from thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/IAttributeExtensions.groovy rename to thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/IAttributeExtensions.groovy index 0539a9db4..acf4bb11c 100644 --- a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/IAttributeExtensions.groovy +++ b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/IAttributeExtensions.groovy @@ -1,12 +1,12 @@ -/* +/* * Copyright 2016, Emanuel Rabina (http://www.ultraq.net.nz/) - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -14,13 +14,13 @@ * limitations under the License. */ -package nz.net.ultraq.thymeleaf.layoutdialect.models.extensions +package nz.net.ultraq.thymeleaf.layoutdialect.extensions import org.thymeleaf.model.IAttribute /** * Meta-programming extensions to the {@link IAttribute} class. - * + * * @author Emanuel Rabina */ class IAttributeExtensions { @@ -29,7 +29,7 @@ class IAttributeExtensions { * Returns whether or not an attribute is an attribute processor of * the given name, checks both prefix:processor and * data-prefix-processor variants. - * + * * @param self * @param prefix * @param name diff --git a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/ICloseElementTagExtensions.groovy b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/ICloseElementTagExtensions.groovy similarity index 92% rename from thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/ICloseElementTagExtensions.groovy rename to thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/ICloseElementTagExtensions.groovy index 1098d5595..3f7682630 100644 --- a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/ICloseElementTagExtensions.groovy +++ b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/ICloseElementTagExtensions.groovy @@ -1,12 +1,12 @@ -/* +/* * Copyright 2016, Emanuel Rabina (http://www.ultraq.net.nz/) - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -14,20 +14,20 @@ * limitations under the License. */ -package nz.net.ultraq.thymeleaf.layoutdialect.models.extensions +package nz.net.ultraq.thymeleaf.layoutdialect.extensions import org.thymeleaf.model.ICloseElementTag /** * Meta-programming extensions to the {@link ICloseElementTag} class. - * + * * @author Emanuel Rabina */ class ICloseElementTagExtensions { /** * Compares this close tag with another. - * + * * @param self * @param other * @return {@code true} if this tag has the same name as the other diff --git a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/context/extensions/IContextExtensions.groovy b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/IContextExtensions.groovy similarity index 96% rename from thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/context/extensions/IContextExtensions.groovy rename to thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/IContextExtensions.groovy index 0466731f4..711d354a9 100644 --- a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/context/extensions/IContextExtensions.groovy +++ b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/IContextExtensions.groovy @@ -1,12 +1,12 @@ -/* +/* * Copyright 2016, Emanuel Rabina (http://www.ultraq.net.nz/) - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -14,14 +14,14 @@ * limitations under the License. */ -package nz.net.ultraq.thymeleaf.layoutdialect.context.extensions +package nz.net.ultraq.thymeleaf.layoutdialect.extensions import org.thymeleaf.context.IContext import org.thymeleaf.dialect.IProcessorDialect /** * Meta-programming extensions to the {@link IContext} class. - * + * * @author Emanuel Rabina */ class IContextExtensions { @@ -31,7 +31,7 @@ class IContextExtensions { /** * Enables use of the {@code value = context[key]} syntax over the context * object, is a synonym for the {@code getVariable} method. - * + * * @param self * @param name Name of the variable on the context to retrieve. * @return The variable value, or {@code null} if the variable isn't @@ -44,7 +44,7 @@ class IContextExtensions { /** * Returns the configured prefix for the given dialect. If the dialect * prefix has not been configured. - * + * * @param self * @param dialectClass * @return The configured prefix for the dialect, or {@code null} if the @@ -64,7 +64,7 @@ class IContextExtensions { /** * Enables use of the {@code context[key] = value} syntax over the context * object, is a synonym for the {@code setVariable} method. - * + * * @param self * @param name Name of the variable to map the value to. * @param value The value to set. diff --git a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/IModelExtensions.groovy b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/IModelExtensions.groovy similarity index 97% rename from thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/IModelExtensions.groovy rename to thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/IModelExtensions.groovy index 49de761b9..09a583b40 100644 --- a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/IModelExtensions.groovy +++ b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/IModelExtensions.groovy @@ -1,12 +1,12 @@ -/* +/* * Copyright 2016, Emanuel Rabina (http://www.ultraq.net.nz/) - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -14,7 +14,10 @@ * limitations under the License. */ -package nz.net.ultraq.thymeleaf.layoutdialect.models.extensions +package nz.net.ultraq.thymeleaf.layoutdialect.extensions + +import nz.net.ultraq.thymeleaf.layoutdialect.models.ChildModelIterator +import nz.net.ultraq.thymeleaf.layoutdialect.models.EventIterator import org.thymeleaf.engine.TemplateModel import org.thymeleaf.model.ICloseElementTag @@ -28,14 +31,14 @@ import groovy.transform.stc.SimpleType /** * Meta-programming extensions to the {@link IModel} class. - * + * * @author Emanuel Rabina */ class IModelExtensions { /** * Set that a model evaluates to 'false' if it has no events. - * + * * @param self * @return {@code true} if this model has events. */ @@ -46,7 +49,7 @@ class IModelExtensions { /** * If this model represents an element, then this method returns an * iterator over any potential child items as models of their own. - * + * * @param self * @param modelFactory * @return New model iterator. @@ -57,7 +60,7 @@ class IModelExtensions { /** * Iterate through each event in the model. - * + * * @param self * @param closure */ @@ -70,7 +73,7 @@ class IModelExtensions { /** * Compare 2 models, returning {@code true} if all of the model's events * are equal. - * + * * @param self * @param other * @return {@code true} if this model is the same as the other one. @@ -86,7 +89,7 @@ class IModelExtensions { /** * Return {@code true} only if all the events in the model return * {@code true} for the given closure. - * + * * @param self * @param closure * @return {@code true} if every event satisfies the closure. @@ -105,7 +108,7 @@ class IModelExtensions { /** * Returns the first event in the model that meets the criteria of the * given closure. - * + * * @param self * @param closure * @return The first event to match the closure criteria, or {@code null} @@ -119,7 +122,7 @@ class IModelExtensions { /** * Find all events in the model that match the given closure. - * + * * @param self * @param closure * @return A list of matched events. @@ -133,7 +136,7 @@ class IModelExtensions { /** * Returns the index of the first event in the model that meets the * criteria of the given closure. - * + * * @param self * @param closure * @return The index of the first event to match the closure criteria, or @@ -148,12 +151,12 @@ class IModelExtensions { /** * A special variant of {@code findIndexOf} that uses models, as I seem to * be using those a lot. - * + * * This doesn't use an equality check, but an object reference check, so * if a submodel is ever located from a parent (eg: any of the {@code find} * methods, you can use this method to find the location of that submodel * within the event queue. - * + * * @param self * @param model * @return Index of an extracted submodel within this model. @@ -166,7 +169,7 @@ class IModelExtensions { /** * Returns the first instance of a model that meets the given closure * criteria. - * + * * @param self * @param closure * @return A model over the event that matches the closure criteria, or @@ -180,7 +183,7 @@ class IModelExtensions { /** * Returns the first event on the model. - * + * * @param self * @return The model's first event. */ @@ -192,7 +195,7 @@ class IModelExtensions { * Returns the model at the given index. If the event at the index is an * opening element, then the returned model will consist of that element * and all the way through to the matching closing element. - * + * * @param self * @param pos A valid index within the current model. * @return Model at the given position, or `null` if the position is @@ -220,7 +223,7 @@ class IModelExtensions { *

* This is currently only targeting uses in the layout dialect so doesn't work * very well as a general-purpose whitespace generator. - * + * * @param self * @param pos A valid index within the current model. * @param model @@ -256,7 +259,7 @@ class IModelExtensions { /** * Inserts an event, creating a whitespace event before it so that it * appears in line with all the existing events. - * + * * @param self * @param pos A valid index within the current model. * @param event @@ -290,7 +293,7 @@ class IModelExtensions { /** * Returns whether or not this model represents a single HTML element. - * + * * @param self * @return {@code true} if the first event in this model is an opening tag * and the last event is the matching closing tag. @@ -301,7 +304,7 @@ class IModelExtensions { /** * Returns whether or not this model represents collapsible whitespace. - * + * * @param self * @return {@code true} if this is a collapsible text model. */ @@ -311,7 +314,7 @@ class IModelExtensions { /** * Used to make this class iterable as an event queue. - * + * * @param self * @return A new iterator over the events of this model. */ @@ -321,7 +324,7 @@ class IModelExtensions { /** * Returns the last event on the model. - * + * * @param self * @return The model's last event. */ @@ -334,7 +337,7 @@ class IModelExtensions { * Remove a model identified by an event matched by the given closure. Note * that this closure can match any event in the model, including the top-level * model itself. - * + * * @param self * @param closure */ @@ -353,7 +356,7 @@ class IModelExtensions { /** * If the model represents an element open to close tags, then this method * removes all of the inner events. - * + * * @param self */ static void removeChildren(IModel self) { @@ -366,7 +369,7 @@ class IModelExtensions { /** * Removes the first event on the model. - * + * * @param self */ static void removeFirst(IModel self) { @@ -375,7 +378,7 @@ class IModelExtensions { /** * Removes the last event on the model. - * + * * @param self */ static void removeLast(IModel self) { @@ -387,7 +390,7 @@ class IModelExtensions { * this means is that, if the event at the position is an opening element, * then it, and everything up to and including its matching end element, * is removed. - * + * * @param self * @param pos A valid index within the current model. */ @@ -403,7 +406,7 @@ class IModelExtensions { /** * Replaces the model at the specified index with the given model. - * + * * @param self * @param pos A valid index within the current model. * @param model @@ -419,7 +422,7 @@ class IModelExtensions { * If an opening element exists at the given position, this method will * return the 'size' of that element (number of events from here to its * matching closing tag). - * + * * @param self * @param model * @param index @@ -461,7 +464,7 @@ class IModelExtensions { /** * Removes whitespace events from the head and tail of the model's * underlying event queue. - * + * * @param self */ static void trim(IModel self) { diff --git a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/IProcessableElementTagExtensions.groovy b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/IProcessableElementTagExtensions.groovy similarity index 96% rename from thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/IProcessableElementTagExtensions.groovy rename to thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/IProcessableElementTagExtensions.groovy index 6131504c2..03d932754 100644 --- a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/IProcessableElementTagExtensions.groovy +++ b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/IProcessableElementTagExtensions.groovy @@ -1,12 +1,12 @@ -/* +/* * Copyright 2016, Emanuel Rabina (http://www.ultraq.net.nz/) - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -14,7 +14,7 @@ * limitations under the License. */ -package nz.net.ultraq.thymeleaf.layoutdialect.models.extensions +package nz.net.ultraq.thymeleaf.layoutdialect.extensions import org.thymeleaf.context.IContext import org.thymeleaf.model.IProcessableElementTag @@ -22,14 +22,14 @@ import org.thymeleaf.standard.StandardDialect /** * Meta-programming extensions to the {@link IProcessableElementTag} class. - * + * * @author Emanuel Rabina */ class IProcessableElementTagExtensions { /** * Compare processable elements for equality. - * + * * @param self * @param other * @return {@code true} if this tag has the same name and attributes as @@ -45,7 +45,7 @@ class IProcessableElementTagExtensions { /** * Compare elements, ignoring XML namespace declarations and Thymeleaf's * {@code th:with} processor. - * + * * @param self * @param other * @param context diff --git a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/IStandaloneElementTagExtensions.groovy b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/IStandaloneElementTagExtensions.groovy similarity index 93% rename from thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/IStandaloneElementTagExtensions.groovy rename to thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/IStandaloneElementTagExtensions.groovy index f1a2dd9d1..5fb42c718 100644 --- a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/IStandaloneElementTagExtensions.groovy +++ b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/IStandaloneElementTagExtensions.groovy @@ -1,12 +1,12 @@ -/* +/* * Copyright 2016, Emanuel Rabina (http://www.ultraq.net.nz/) - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -14,20 +14,20 @@ * limitations under the License. */ -package nz.net.ultraq.thymeleaf.layoutdialect.models.extensions +package nz.net.ultraq.thymeleaf.layoutdialect.extensions import org.thymeleaf.model.IStandaloneElementTag /** * Meta-programming extensions to the {@link IStandaloneElementTag} class. - * + * * @author Emanuel Rabina */ class IStandaloneElementTagExtensions { /** * Compares this standalone tag with another. - * + * * @param self * @param other * @return {@code true} if this tag has the same name and attributes as diff --git a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/ITemplateEventExtensions.groovy b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/ITemplateEventExtensions.groovy similarity index 97% rename from thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/ITemplateEventExtensions.groovy rename to thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/ITemplateEventExtensions.groovy index 83f46ec9a..f0d115722 100644 --- a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/ITemplateEventExtensions.groovy +++ b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/ITemplateEventExtensions.groovy @@ -14,7 +14,7 @@ * limitations under the License. */ -package nz.net.ultraq.thymeleaf.layoutdialect.models.extensions +package nz.net.ultraq.thymeleaf.layoutdialect.extensions import org.thymeleaf.model.ICloseElementTag import org.thymeleaf.model.IOpenElementTag diff --git a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/ITextExtensions.groovy b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/ITextExtensions.groovy similarity index 93% rename from thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/ITextExtensions.groovy rename to thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/ITextExtensions.groovy index 14655f19c..5ad8554f3 100644 --- a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/ITextExtensions.groovy +++ b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/extensions/ITextExtensions.groovy @@ -1,12 +1,12 @@ -/* +/* * Copyright 2016, Emanuel Rabina (http://www.ultraq.net.nz/) - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -14,20 +14,20 @@ * limitations under the License. */ -package nz.net.ultraq.thymeleaf.layoutdialect.models.extensions +package nz.net.ultraq.thymeleaf.layoutdialect.extensions import org.thymeleaf.model.IText /** * Meta-programming extensions to the {@link IText} class. - * + * * @author Emanuel Rabina */ class ITextExtensions { /** * Compares this text with another. - * + * * @param self * @param other * @return {@code true} if the text content matches. @@ -39,7 +39,7 @@ class ITextExtensions { /** * Returns whether or not this text event is collapsible whitespace. - * + * * @param self * @return {@code true} if, when trimmed, the text content is empty. */ diff --git a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/ChildModelIterator.groovy b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/ChildModelIterator.groovy similarity index 93% rename from thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/ChildModelIterator.groovy rename to thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/ChildModelIterator.groovy index d402fe9fa..aaba39081 100644 --- a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/ChildModelIterator.groovy +++ b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/ChildModelIterator.groovy @@ -1,12 +1,12 @@ -/* +/* * Copyright 2016, Emanuel Rabina (http://www.ultraq.net.nz/) - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -14,14 +14,14 @@ * limitations under the License. */ -package nz.net.ultraq.thymeleaf.layoutdialect.models.extensions +package nz.net.ultraq.thymeleaf.layoutdialect.models import org.thymeleaf.model.IModel /** * An iterator that works with a model's immediate children, returning each one * as a model of its own. - * + * * @author Emanuel Rabina */ class ChildModelIterator implements Iterator { diff --git a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/EventIterator.groovy b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/EventIterator.groovy similarity index 92% rename from thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/EventIterator.groovy rename to thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/EventIterator.groovy index 152688a61..35a632a7e 100644 --- a/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/EventIterator.groovy +++ b/thymeleaf-layout-dialect/source/nz/net/ultraq/thymeleaf/layoutdialect/models/EventIterator.groovy @@ -1,12 +1,12 @@ -/* +/* * Copyright 2019, Emanuel Rabina (http://www.ultraq.net.nz/) - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -14,13 +14,15 @@ * limitations under the License. */ -package nz.net.ultraq.thymeleaf.layoutdialect.models.extensions +package nz.net.ultraq.thymeleaf.layoutdialect.models import org.thymeleaf.model.IModel import org.thymeleaf.model.ITemplateEvent /** * An iterator that treats a model as a queue of events. + * + * @author Emanuel Rabina */ class EventIterator implements Iterator { diff --git a/thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/fragments/extensions/FragmentExtensionsTests.groovy b/thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/extensions/FragmentExtensionsTests.groovy similarity index 95% rename from thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/fragments/extensions/FragmentExtensionsTests.groovy rename to thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/extensions/FragmentExtensionsTests.groovy index 5c3d8cd27..ee57ccf13 100644 --- a/thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/fragments/extensions/FragmentExtensionsTests.groovy +++ b/thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/extensions/FragmentExtensionsTests.groovy @@ -1,12 +1,12 @@ -/* +/* * Copyright 2016, Emanuel Rabina (http://www.ultraq.net.nz/) - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -14,11 +14,10 @@ * limitations under the License. */ -package nz.net.ultraq.thymeleaf.layoutdialect.fragments.extensions +package nz.net.ultraq.thymeleaf.layoutdialect.extensions import org.thymeleaf.cache.ICacheEntryValidity import org.thymeleaf.context.ITemplateContext - import org.thymeleaf.engine.TemplateData import org.thymeleaf.templatemode.TemplateMode import org.thymeleaf.templateresource.ITemplateResource @@ -26,7 +25,7 @@ import spock.lang.Specification /** * Tests for extensions made to Thymeleaf classes for working with fragments. - * + * * @author Emanuel Rabina */ @SuppressWarnings('PrivateFieldCouldBeFinal') diff --git a/thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/IModelExtensionsTests.groovy b/thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/extensions/IModelExtensionsTests.groovy similarity index 97% rename from thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/IModelExtensionsTests.groovy rename to thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/extensions/IModelExtensionsTests.groovy index 3bbd34e2e..56caf61ee 100644 --- a/thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/IModelExtensionsTests.groovy +++ b/thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/extensions/IModelExtensionsTests.groovy @@ -1,12 +1,12 @@ -/* +/* * Copyright 2016, Emanuel Rabina (http://www.ultraq.net.nz/) - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -14,7 +14,7 @@ * limitations under the License. */ -package nz.net.ultraq.thymeleaf.layoutdialect.models.extensions +package nz.net.ultraq.thymeleaf.layoutdialect.extensions import nz.net.ultraq.thymeleaf.layoutdialect.LayoutDialect import nz.net.ultraq.thymeleaf.layoutdialect.models.ModelBuilder @@ -25,7 +25,7 @@ import spock.lang.Specification /** * Tests for some of the more complicated additions to the model class. - * + * * @author Emanuel Rabina */ @SuppressWarnings('ExplicitCallToDivMethod') diff --git a/thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/ChildModelIteratorTests.groovy b/thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/models/ChildModelIteratorTests.groovy similarity index 90% rename from thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/ChildModelIteratorTests.groovy rename to thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/models/ChildModelIteratorTests.groovy index d6feaff8a..a1845d0c7 100644 --- a/thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/ChildModelIteratorTests.groovy +++ b/thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/models/ChildModelIteratorTests.groovy @@ -1,12 +1,12 @@ -/* +/* * Copyright 2016, Emanuel Rabina (http://www.ultraq.net.nz/) - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -14,18 +14,17 @@ * limitations under the License. */ -package nz.net.ultraq.thymeleaf.layoutdialect.models.extensions +package nz.net.ultraq.thymeleaf.layoutdialect.models import nz.net.ultraq.thymeleaf.layoutdialect.LayoutDialect -import nz.net.ultraq.thymeleaf.layoutdialect.models.ModelBuilder import org.thymeleaf.TemplateEngine import org.thymeleaf.templatemode.TemplateMode import spock.lang.Specification /** - * Tests for the {@link ChildModelIterator} class. - * + * Tests for the {@link nz.net.ultraq.thymeleaf.layoutdialect.models.ChildModelIterator} class. + * * @author Emanuel Rabina */ class ChildModelIteratorTests extends Specification { diff --git a/thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/ModelLevel.thtest b/thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/models/ModelLevel.thtest similarity index 100% rename from thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/models/extensions/ModelLevel.thtest rename to thymeleaf-layout-dialect/test/nz/net/ultraq/thymeleaf/layoutdialect/models/ModelLevel.thtest