All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sun.msv.reader.ExpressionState Maven / Gradle / Ivy

There is a newer version: 2.2.5.1
Show newest version
/*
 * @(#)$Id: ExpressionState.java,v 1.5 2003/06/09 20:37:23 kk122374 Exp $
 *
 * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved.
 * 
 * This software is the proprietary information of Sun Microsystems, Inc.  
 * Use is subject to license terms.
 * 
 */
package com.sun.msv.reader;

import com.sun.msv.grammar.Expression;

/**
 * Base implementation for those states who read tags representing an expression.
 * 
 * 

* Responsibility of derived classes are: * *

    *
  1. if necessary, implement startSelf method to do something. *
  2. implement createChildState method, which is mandated by SimpleState. *
  3. implement makeExpression method to create Expression object * as the outcome of parsing. This method is called at endElement. *
* * @author Kohsuke KAWAGUCHI */ public abstract class ExpressionState extends SimpleState { protected void endSelf() { // creates a expression, then calls a hook of reader, Expression exp = reader.interceptExpression( this, makeExpression() ); if( parentState!=null ) // then finally pass it to the parent ((ExpressionOwner)parentState).onEndChild(exp); // interceptExpression is a hook by reader. // it is used to implement handling of occurs attribute in RELAX. // application-defined reader can also do something useful for them here. super.endSelf(); } /** * This method is called from endElement method. * Implementation has to provide Expression object that represents the content of * this element. */ protected abstract Expression makeExpression(); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy