org.jboss.dna.graph.connector.federation
Class Projection.Rule

java.lang.Object
  extended by org.jboss.dna.graph.connector.federation.Projection.Rule
All Implemented Interfaces:
Comparable<Projection.Rule>
Direct Known Subclasses:
Projection.PathRule
Enclosing class:
Projection

@Immutable
public abstract static class Projection.Rule
extends Object
implements Comparable<Projection.Rule>

A rule used within a project do define how content within a source is projected into the federated repository. This mapping is bi-directional, meaning it's possible to determine

Author:
Randall Hauch

Constructor Summary
Projection.Rule()
           
 
Method Summary
abstract  Path getPathInRepository(Path pathInSource, PathFactory factory)
          Get the path in repository that is projected from the supplied source path, or null if the supplied source path is not projected into the repository.
abstract  Path getPathInSource(Path pathInRepository, PathFactory factory)
          Get the path in source that is projected from the supplied repository path, or null if the supplied repository path is not projected into the source.
abstract  String getString()
           
abstract  String getString(NamespaceRegistry registry, TextEncoder encoder)
           
abstract  String getString(TextEncoder encoder)
           
abstract  List<Path> getTopLevelPathsInRepository(PathFactory factory)
          Get the paths in the repository that serve as top-level nodes exposed by this rule.
abstract  boolean isTopLevelPath(Path path)
          Determine if the supplied path is the same as one of the top-level nodes exposed by this rule.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

Projection.Rule

public Projection.Rule()
Method Detail

getTopLevelPathsInRepository

public abstract List<Path> getTopLevelPathsInRepository(PathFactory factory)
Get the paths in the repository that serve as top-level nodes exposed by this rule.

Parameters:
factory - the path factory that can be used to create new paths; may not be null
Returns:
the list of top-level paths, which are ordered and which must be unique; never null

isTopLevelPath

public abstract boolean isTopLevelPath(Path path)
Determine if the supplied path is the same as one of the top-level nodes exposed by this rule.

Parameters:
path - the path; may not be null
Returns:
true if the supplied path is also one of the top-level paths , or false otherwise

getPathInSource

public abstract Path getPathInSource(Path pathInRepository,
                                     PathFactory factory)
Get the path in source that is projected from the supplied repository path, or null if the supplied repository path is not projected into the source.

Parameters:
pathInRepository - the path in the repository; may not be null
factory - the path factory; may not be null
Returns:
the path in source if it is projected by this rule, or null otherwise

getPathInRepository

public abstract Path getPathInRepository(Path pathInSource,
                                         PathFactory factory)
Get the path in repository that is projected from the supplied source path, or null if the supplied source path is not projected into the repository.

Parameters:
pathInSource - the path in the source; may not be null
factory - the path factory; may not be null
Returns:
the path in repository if it is projected by this rule, or null otherwise

getString

public abstract String getString(NamespaceRegistry registry,
                                 TextEncoder encoder)

getString

public abstract String getString(TextEncoder encoder)

getString

public abstract String getString()


Copyright © 2008-2009 JBoss, a division of Red Hat. All Rights Reserved.