|
Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.bea.p13n.model.DefaultDocumentModel
com.bea.p13n.rules.model.RuleModelDocument
public class RuleModelDocument
A default model document for RuleModels. This also provides common methods for parsing and writing rule xml in the preferred manner.
| Field Summary | |
|---|---|
static String |
DEFAULT_ENCODING
The default character encoding to use, if document's don't specify one themselves. |
static String |
schemaLocation
The xsi:schemaLocation value for rule documents. |
static Map<String,String> |
suggestedPrefixes
The unmodifiable map of namespace uri to preferred prefix for rule xml. |
| Constructor Summary | |
|---|---|
RuleModelDocument(InputStream in)
Constructor from an input stream. |
|
RuleModelDocument(Reader in)
Constructor from an input reader. |
|
RuleModelDocument(RuleModel rm)
Constructor from RuleModel. |
|
RuleModelDocument(String in)
Constructor from xml. |
|
| Method Summary | |
|---|---|
static org.apache.xmlbeans.XmlOptions |
getSaveOptions()
Get default XmlOptions for saving/outputting rule xml. |
static RuleModel |
parseRuleModel(InputStream xml,
Collection errors)
Parse a rule model from an input stream |
static RuleModel |
parseRuleModel(Reader xml,
Collection errors)
Parse a rule model from a reader. |
static RuleModel |
parseRuleModel(String xml,
Collection errors)
Parse a rule model from xml. |
static com.bea.p13n.rules.schema.RuleDocument |
prepareForSave(RuleModel rm,
String encoding,
org.apache.xmlbeans.XmlOptions opts)
Prepare a RuleDocument xml object from the RuleModel. |
static boolean |
setSchemaLocation(org.apache.xmlbeans.XmlObject o,
String loc)
Set the xsi:schemaLocation attribute of the specified object to the specified value (null to remove). |
static InputStream |
toInputStream(RuleModel rm)
Get an input stream of the specified RuleModel's xml. |
static InputStream |
toInputStream(RuleModel rm,
String encoding)
Get an input stream of the specified RuleModel's xml. |
static Reader |
toReader(RuleModel rm)
Get a reader of the specified RuleModel's xml. |
static Reader |
toReader(RuleModel rm,
String encoding)
Get a reader of the specified RuleModel's xml. |
static String |
toString(RuleModel rm)
Get the specified RuleModel's xml. |
static String |
toString(RuleModel rm,
String encoding)
Get the specified RuleModel's xml. |
| Methods inherited from class com.bea.p13n.model.DefaultDocumentModel |
|---|
addChangeListener, getRootModel, modelChildAdded, modelChildRemoved, modelPropertyChanged, removeChangeListener, setRootModel |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Map<String,String> suggestedPrefixes
public static final String DEFAULT_ENCODING
public static final String schemaLocation
| Constructor Detail |
|---|
public RuleModelDocument(RuleModel rm)
public RuleModelDocument(Reader in)
throws org.apache.xmlbeans.XmlException,
IllegalArgumentException,
IOException
org.apache.xmlbeans.XmlException - on a parsing exception
IllegalArgumentException - if the xml is not valid for RuleModel.
IOException - on an error reading from the stream.
public RuleModelDocument(InputStream in)
throws org.apache.xmlbeans.XmlException,
IllegalArgumentException,
IOException
org.apache.xmlbeans.XmlException - on a parsing exception
IllegalArgumentException - if the xml is not valid for RuleModel.
IOException - on an error reading from the stream.
public RuleModelDocument(String in)
throws org.apache.xmlbeans.XmlException,
IllegalArgumentException
org.apache.xmlbeans.XmlException - on a parsing exception
IllegalArgumentException - if the xml is not valid for RuleModel.| Method Detail |
|---|
public static RuleModel parseRuleModel(String xml,
Collection errors)
throws org.apache.xmlbeans.XmlException,
IllegalArgumentException
xml - the xml string.errors - a collection to store any XmlErrors from the parse.
org.apache.xmlbeans.XmlException - on a parsing exception
IllegalArgumentException - if the xml is not valid for RuleModel.
public static RuleModel parseRuleModel(Reader xml,
Collection errors)
throws org.apache.xmlbeans.XmlException,
IllegalArgumentException,
IOException
xml - the xml readererrors - a collection to store any XmlErrors from the parse.
org.apache.xmlbeans.XmlException - on a parsing exception.
IllegalArgumentException - if the xml is not valid for RuleModel.
IOException - on an error reading from the stream.
public static RuleModel parseRuleModel(InputStream xml,
Collection errors)
throws org.apache.xmlbeans.XmlException,
IllegalArgumentException,
IOException
xml - the xml input streaml.errors - a collection to store any XmlErrors from the parse.
org.apache.xmlbeans.XmlException - on a parsing exception.
IllegalArgumentException - if the xml is not valid for RuleModel.
IOException - on an error reading from the stream.
public static boolean setSchemaLocation(org.apache.xmlbeans.XmlObject o,
String loc)
o - the document or element object.loc - the schemaLocation value or null to remove.
public static org.apache.xmlbeans.XmlOptions getSaveOptions()
suggestedPrefixes
public static com.bea.p13n.rules.schema.RuleDocument prepareForSave(RuleModel rm,
String encoding,
org.apache.xmlbeans.XmlOptions opts)
rm - the rule model.encoding - the encoding to use, null for default.opts - the opts to modify appropriately.public static InputStream toInputStream(RuleModel rm)
public static InputStream toInputStream(RuleModel rm,
String encoding)
public static Reader toReader(RuleModel rm)
public static Reader toReader(RuleModel rm,
String encoding)
rm - the rule model.encoding - the character encoding to use, null for model's default
encoding.public static String toString(RuleModel rm)
public static String toString(RuleModel rm,
String encoding)
rm - the rule model.encoding - the character encoding to use, null for model's default
encoding.
|
Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||