org.apache.falcon.entity.parser
Class EntityParser<T extends Entity>

java.lang.Object
  extended by org.apache.falcon.entity.parser.EntityParser<T>
Type Parameters:
T - of type Entity
Direct Known Subclasses:
ClusterEntityParser, FeedEntityParser, ProcessEntityParser

public abstract class EntityParser<T extends Entity>
extends Object

Generic Abstract Entity Parser, the concrete FEED, PROCESS and CLUSTER should extend this parser to implement specific parsing.


Constructor Summary
protected EntityParser(EntityType entityType)
           
 
Method Summary
 EntityType getEntityType()
           
 T parse(InputStream xmlStream)
          Parses xml stream.
 T parseAndValidate(InputStream xmlStream)
           
 Entity parseAndValidate(String xmlString)
          Parses a sent XML and validates it using JAXB.
abstract  void validate(T entity)
           
protected  void validateEntitiesExist(List<Pair<EntityType,String>> entities)
           
protected  void validateEntityExists(EntityType type, String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityParser

protected EntityParser(EntityType entityType)
Method Detail

getEntityType

public EntityType getEntityType()

parseAndValidate

public Entity parseAndValidate(String xmlString)
                        throws FalconException
Parses a sent XML and validates it using JAXB.

Parameters:
xmlString - - Entity XML
Returns:
Entity - JAVA Object
Throws:
FalconException

parse

public T parse(InputStream xmlStream)
                       throws FalconException
Parses xml stream.

Parameters:
xmlStream - stream
Returns:
entity
Throws:
FalconException

parseAndValidate

public T parseAndValidate(InputStream xmlStream)
                                  throws FalconException
Throws:
FalconException

validateEntityExists

protected void validateEntityExists(EntityType type,
                                    String name)
                             throws FalconException
Throws:
FalconException

validateEntitiesExist

protected void validateEntitiesExist(List<Pair<EntityType,String>> entities)
                              throws FalconException
Throws:
FalconException

validate

public abstract void validate(T entity)
                       throws FalconException
Throws:
FalconException


Copyright © 2013-2014 Apache Software Foundation. All Rights Reserved.