org.apache.falcon.entity.parser
Class EntityParser<T extends Entity>
java.lang.Object
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EntityParser
protected EntityParser(EntityType entityType)
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.