Java Doc for PrefixMapping.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » shared » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » RSS RDF » Jena 2.5.5 » com.hp.hpl.jena.shared 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.hp.hpl.jena.shared.PrefixMapping

All known Subclasses:   com.hp.hpl.jena.shared.impl.PrefixMappingImpl,  com.hp.hpl.jena.rdf.model.impl.ModelCom,  com.hp.hpl.jena.graph.compose.PolyadicPrefixMappingImpl,
PrefixMapping
public interface PrefixMapping (Code)
Methods for recording namepsace prefix mappings and applying and unapplying them to URIs.

Note that a Model *is* a PrefixMapping, so all the PrefixMapping operations apply to Models, and a Model can be used to supply the PrefixMapping argument to setNsPrefixes.
author:
   kers


Inner Class :public static class IllegalPrefixException extends JenaException
Inner Class :public static class JenaLockedException extends JenaException
Inner Class :public static class Factory

Field Summary
final public static  PrefixMappingExtended
    
final public static  PrefixMappingStandard
     A PrefixMapping that contains the "standard" prefixes we know about, viz rdf, rdfs, dc, rss, vcard, and owl.


Method Summary
 StringexpandPrefix(String prefixed)
     Expand the uri using the prefix mappings if possible.
 MapgetNsPrefixMap()
     Return a copy of the internal mapping from names to URI strings.
 StringgetNsPrefixURI(String prefix)
     Get the URI bound to a specific prefix, null if there isn't one.
 StringgetNsURIPrefix(String uri)
     Answer the prefix for the given URI, or null if there isn't one. If there is more than one, one of them will be picked.
 PrefixMappinglock()
     Lock the PrefixMapping so that changes can no longer be made to it.
 StringqnameFor(String uri)
     Answer a qname with the expansion of the given uri, or null if no such qname can be constructed using the mapping's prefixes.
 PrefixMappingremoveNsPrefix(String prefix)
     Remove any existing maplet with the given prefix name and answer this mapping.
 booleansamePrefixMappingAs(PrefixMapping other)
     Answer true iff this prefix-mappings are equal, that is, map the same prefixes to the same URIs; same as
this.getNsPrefixMap().equals( other.getNsPrefixMap() )
except that it may avoid unnecessary Map creations.
 PrefixMappingsetNsPrefix(String prefix, String uri)
     Specify the prefix name for a URI prefix string.
 PrefixMappingsetNsPrefixes(PrefixMapping other)
     Copies the prefixes from other into this.
 PrefixMappingsetNsPrefixes(Map map)
     Copies the prefix mapping from other into this.
 StringshortForm(String uri)
     Compress the URI using the prefix mappings if possible.
 PrefixMappingwithDefaultMappings(PrefixMapping map)
     Update this PrefixMapping with the bindings in map, only adding those (p, u) pairs for which neither p nor u appears in this mapping.

Field Detail
Extended
final public static PrefixMapping Extended(Code)
A PrefixMapping built on Standard with some extras



Standard
final public static PrefixMapping Standard(Code)
A PrefixMapping that contains the "standard" prefixes we know about, viz rdf, rdfs, dc, rss, vcard, and owl.





Method Detail
expandPrefix
String expandPrefix(String prefixed)(Code)
Expand the uri using the prefix mappings if possible. If prefixed has the form Foo:Bar, and Foo is a prefix bound to FooURI, return FooURI+Bar. Otherwise return prefixed unchanged.
Parameters:
  prefixed - a QName or URI the expanded string if possible, otherwise the original string



getNsPrefixMap
Map getNsPrefixMap()(Code)
Return a copy of the internal mapping from names to URI strings. Updating this copy will have no effect on the PrefixMap. a copy of the internal String -> String mapping



getNsPrefixURI
String getNsPrefixURI(String prefix)(Code)
Get the URI bound to a specific prefix, null if there isn't one.
Parameters:
  prefix - the prefix name to be looked up the most recent URI bound to that prefix name, null if none



getNsURIPrefix
String getNsURIPrefix(String uri)(Code)
Answer the prefix for the given URI, or null if there isn't one. If there is more than one, one of them will be picked. If possible, it will be the most recently added prefix. (The cases where it's not possible is when a binding has been removed.)
Parameters:
  uri - the uri whose prefix is to be found the prefix mapped to that uri, or null if there isn't one



lock
PrefixMapping lock()(Code)
Lock the PrefixMapping so that changes can no longer be made to it. Primarily intended to lock Standard against mutation. this mapping, locked against changes



qnameFor
String qnameFor(String uri)(Code)
Answer a qname with the expansion of the given uri, or null if no such qname can be constructed using the mapping's prefixes.



removeNsPrefix
PrefixMapping removeNsPrefix(String prefix)(Code)
Remove any existing maplet with the given prefix name and answer this mapping. If the prefix is the empty string, then this removes the default namespace. If the prefix is not a legal prefix string, or is not present in the mapping, nothing happens.

The reverse URI-to-prefix mapping is updated, but if there are multiple prefixes for the removed URI it is unspecified which of them will be chosen.
Parameters:
  prefix - the prefix string to remove this PrefixMapping




samePrefixMappingAs
boolean samePrefixMappingAs(PrefixMapping other)(Code)
Answer true iff this prefix-mappings are equal, that is, map the same prefixes to the same URIs; same as
this.getNsPrefixMap().equals( other.getNsPrefixMap() )
except that it may avoid unnecessary Map creations.



setNsPrefix
PrefixMapping setNsPrefix(String prefix, String uri)(Code)
Specify the prefix name for a URI prefix string. Any existing use of that prefix name is overwritten. The result is this same prefixMapping. (The earlier restriction that adding second prefix for the same URI caused the earlier binding to be deleted has been withdrawn.)

A prefix name must be a valid NCName, or the empty string. The empty string is reserved to mean "the default namespace".

Need not check the RFC2396 validity of the URI. Bad URIs are either silently ignored or behave as if they were good. The earlier restriction that the URI should end with a non-NCName character has been removed.
Parameters:
  prefix - the string to be used for the prefix.
Parameters:
  uri - the URI prefix to be named
exception:
  IllegalPrefixException - if the prefix is not an XML NCName this PrefixMapping




setNsPrefixes
PrefixMapping setNsPrefixes(PrefixMapping other)(Code)
Copies the prefixes from other into this. Any existing binding of the same prefix is lost. The result is this same prefixMapping.
Parameters:
  other - the PrefixMapping to add this PrefixMapping



setNsPrefixes
PrefixMapping setNsPrefixes(Map map)(Code)
Copies the prefix mapping from other into this. Illegal prefix mappings are detected. Existing binds of the same prefix are lost. The result is this same prefixMapping.
Parameters:
  map - the Map whose maplets are to be added this PrefixMapping



shortForm
String shortForm(String uri)(Code)
Compress the URI using the prefix mappings if possible. If there is a prefix mapping Name -> URIStart, and uri is URIStart+Tail, return Name:Tail; otherwise return uri unchanged. If there are multiple applicable mappings available, the "most recent" is chosen if that is possible, otherwise one is picked "at random".

The result is primarily intended for human convenience: it is not necessarily a legal QName, as Tail need not be a legal NCName; and there's no way to tell a shortened name from a URI with an unusual scheme.
Parameters:
  uri - the URI string to try and prefix-compress the shortened form if possible, otherwise the unchanged argument




withDefaultMappings
PrefixMapping withDefaultMappings(PrefixMapping map)(Code)
Update this PrefixMapping with the bindings in map, only adding those (p, u) pairs for which neither p nor u appears in this mapping. Answer this PrefixMapping.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.