|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.jcr.JackrabbitXmlNodeTypeReader.XmlImporter
protected static class JackrabbitXmlNodeTypeReader.XmlImporter
Field Summary | |
---|---|
protected Destination |
destination
|
protected NameFactory |
nameFactory
|
protected Path |
outputPath
|
protected PathFactory |
pathFactory
|
protected PropertyFactory |
propertyFactory
|
protected List<String> |
VALID_ON_PARENT_VERSION
|
protected ValueFactories |
valueFactories
|
Constructor Summary | |
---|---|
JackrabbitXmlNodeTypeReader.XmlImporter(Destination destination,
Path parentPath)
Create a new importer that will place the content in the supplied destination under the supplied path. |
|
JackrabbitXmlNodeTypeReader.XmlImporter(Destination destination,
Path parentPath,
boolean compatibleWithPreJcr2)
Create a new importer that will place the content in the supplied destination under the supplied path. |
Method Summary | |
---|---|
void |
importFrom(File file,
Problems problems)
Import the CND content from the supplied stream, placing the content into the importer's destination. |
void |
importFrom(InputStream stream,
Problems problems,
String resourceName)
Import the CND content from the supplied stream, placing the content into the importer's destination. |
void |
importFrom(String content,
Problems problems,
String resourceName)
Import the CND content from the supplied stream, placing the content into the importer's destination. |
protected Name |
name(String name)
|
protected Name |
nameFrom(SubgraphNode node)
|
protected void |
parse(InputStream content,
Problems problems,
String resourceName)
Parse the XML content. |
protected void |
parseChildNodeDefinition(Subgraph subgraph,
SubgraphNode childDefn,
Path parentPath)
Read the property definition from the graph and create the corresponding CND content in the destination. |
protected void |
parseNodeType(Subgraph subgraph,
SubgraphNode nodeType,
Path parentPath)
Parse the node type element. |
protected void |
parsePropertyDefinition(Subgraph subgraph,
SubgraphNode propertyDefn,
Path parentPath)
Read the property definition from the graph and create the corresponding CND content in the destination. |
protected boolean |
readBoolean(SubgraphNode node,
String propertyName,
boolean defaultValue)
|
protected Name |
readName(SubgraphNode node,
String propertyName,
Name defaultValue)
|
protected List<Name> |
readNames(SubgraphNode node,
String propertyName,
Name defaultIfNone)
|
protected String |
readString(SubgraphNode node,
String propertyName,
String defaultValue)
|
protected List<String> |
readStrings(SubgraphNode node,
String propertyName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final List<String> VALID_ON_PARENT_VERSION
protected final Destination destination
protected final Path outputPath
protected final PropertyFactory propertyFactory
protected final PathFactory pathFactory
protected final NameFactory nameFactory
protected final ValueFactories valueFactories
Constructor Detail |
---|
public JackrabbitXmlNodeTypeReader.XmlImporter(Destination destination, Path parentPath, boolean compatibleWithPreJcr2)
destination
- the destination where content is to be writtenparentPath
- the path in the destination below which the generated content is to appearcompatibleWithPreJcr2
- true if this parser should accept the CND format that was used in the reference
implementation prior to JCR 2.0.
IllegalArgumentException
- if either parameter is nullpublic JackrabbitXmlNodeTypeReader.XmlImporter(Destination destination, Path parentPath)
destination
- the destination where content is to be writtenparentPath
- the path in the destination below which the generated content is to appear
IllegalArgumentException
- if either parameter is nullMethod Detail |
---|
public void importFrom(InputStream stream, Problems problems, String resourceName) throws SAXException, IOException
stream
- the stream containing the CND contentproblems
- where any problems encountered during import should be reportedresourceName
- a logical name for the resource name to be used when reporting problems; may be null if there is no
useful name
IOException
- if there is a problem reading from the supplied stream
SAXException
- if there is an error in the XMLpublic void importFrom(File file, Problems problems) throws SAXException, IOException
file
- the file containing the CND contentproblems
- where any problems encountered during import should be reported
IOException
- if there is a problem reading from the supplied file
SAXException
- if there is an error in the XMLpublic void importFrom(String content, Problems problems, String resourceName) throws SAXException, IOException
content
- the string containing the CND contentproblems
- where any problems encountered during import should be reportedresourceName
- a logical name for the resource name to be used when reporting problems; may be null if there is no
useful name
IOException
- if there is a problem reading from the supplied string
SAXException
- if there is an error in the XMLprotected void parse(InputStream content, Problems problems, String resourceName) throws SAXException, IOException
content
- the contentproblems
- where any problems encountered during import should be reportedresourceName
- a logical name for the resource name to be used when reporting problems; may be null if there is no
useful name
IOException
- if there is a problem reading from the supplied stream
SAXException
- if there is an error in the XMLprotected void parseNodeType(Subgraph subgraph, SubgraphNode nodeType, Path parentPath)
<!ELEMENT nodeType (supertypes?|propertyDefinition*|childNodeDefinition*)> <!ATTLIST nodeType name CDATA #REQUIRED isMixin (true|false) #REQUIRED hasOrderableChildNodes (true|false) #REQUIRED primaryItemName CDATA #REQUIRED > <!ELEMENT supertypes (supertype+)> <!ELEMENT supertype (CDATA)>
subgraph
- nodeType
- parentPath
- protected void parsePropertyDefinition(Subgraph subgraph, SubgraphNode propertyDefn, Path parentPath)
<!ELEMENT propertyDefinition (valueConstraints?|defaultValues?)> <!ATTLIST propertyDefinition name CDATA #REQUIRED requiredType (String|Date|Path|Name|Reference|Binary|Double|Long|Boolean|undefined) #REQUIRED autoCreated (true|false) #REQUIRED mandatory (true|false) #REQUIRED onParentVersion (COPY|VERSION|INITIALIZE|COMPUTE|IGNORE|ABORT) #REQUIRED protected (true|false) #REQUIRED multiple (true|false) #REQUIRED > <!ELEMENT valueConstraints (valueConstraint+)> <!ELEMENT valueConstraint (CDATA)> <!ELEMENT defaultValues (defaultValue+)> <!ELEMENT defaultValue (CDATA)>
subgraph
- propertyDefn
- parentPath
- protected void parseChildNodeDefinition(Subgraph subgraph, SubgraphNode childDefn, Path parentPath)
<!ELEMENT childNodeDefinition (requiredPrimaryTypes)> <!ATTLIST childNodeDefinition name CDATA #REQUIRED defaultPrimaryType CDATA #REQUIRED autoCreated (true|false) #REQUIRED mandatory (true|false) #REQUIRED onParentVersion (COPY|VERSION|INITIALIZE|COMPUTE|IGNORE|ABORT) #REQUIRED protected (true|false) #REQUIRED sameNameSiblings (true|false) #REQUIRED > <!ELEMENT requiredPrimaryTypes (requiredPrimaryType+)> <!ELEMENT requiredPrimaryType (CDATA)>
subgraph
- childDefn
- parentPath
- protected Name nameFrom(SubgraphNode node)
protected Name name(String name)
protected boolean readBoolean(SubgraphNode node, String propertyName, boolean defaultValue)
protected String readString(SubgraphNode node, String propertyName, String defaultValue)
protected List<String> readStrings(SubgraphNode node, String propertyName)
protected Name readName(SubgraphNode node, String propertyName, Name defaultValue)
protected List<Name> readNames(SubgraphNode node, String propertyName, Name defaultIfNone)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |