Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
af3
kernel
Commits
c6c831c6
Commit
c6c831c6
authored
12 years ago
by
Florian Hölzl
Browse files
Options
Downloads
Patches
Plain Diff
further rework of code generator (still to weird)
refs 857
parent
eb0928fa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/TransformationProviderBase.java
+63
-0
63 additions, 0 deletions
...ing/kernel/extension/base/TransformationProviderBase.java
with
63 additions
and
0 deletions
org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/TransformationProviderBase.java
0 → 100644
+
63
−
0
View file @
c6c831c6
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2012 ForTISS GmbH |
| |
| 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. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package
org.fortiss.tooling.kernel.extension.base
;
import
org.fortiss.tooling.kernel.extension.ITransformationProvider
;
import
org.fortiss.tooling.kernel.extension.data.ITransformationContext
;
import
org.fortiss.tooling.kernel.extension.exception.TransformationFailedException
;
/**
* Base class for {@link ITransformationProvider}s.
*
* @param <S>
* the source object class
* @param <T>
* the target class
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: E70B50712E9BA8739D02E8FE703FC5C0
*/
public
abstract
class
TransformationProviderBase
<
S
extends
Object
,
T
extends
Object
>
implements
ITransformationProvider
{
/** Returns the source class this provider can handle. */
protected
abstract
Class
<
S
>
getSourceClass
();
/** {@inheritDoc} */
@Override
public
abstract
Class
<
T
>
getTargetClass
();
/** {@inheritDoc} */
@Override
public
abstract
T
transform
(
Object
source
,
ITransformationContext
context
)
throws
TransformationFailedException
;
/** {@inheritDoc} */
@Override
public
boolean
canHandleChainTransformation
(
Class
<?>
sourceClass
,
ITransformationContext
context
)
{
return
getSourceClass
().
isAssignableFrom
(
sourceClass
);
}
/** {@inheritDoc} */
@Override
public
boolean
canTransform
(
Object
source
,
ITransformationContext
context
)
{
return
getSourceClass
().
isInstance
(
source
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment